Repository navigation
fix: harden accounts, PIN sessions and backup recovery - #35
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Malformed account keys could disable all codes, migration QR input could hang the renderer or import HOTP as TOTP, and selected accounts were saved individually. PIN unlock also left the account view stale, inactivity locking was not enforced, pending sensitive operations could finish after locking, and grouped accounts could be silently skipped during backup recovery.
This change validates Base32 consistently, bounds migration parsing, isolates unreadable accounts and imports QR accounts atomically. Main now enforces inactivity locking and locks on OS lock/suspend, publishes validated status events, and invalidates captured sessions across locks. The renderer unmounts sensitive state while locked and reloads accounts immediately after unlock. Code delivery, clipboard writes, account writes and backup operations recheck the captured session after asynchronous work.
Backup payload v2 includes group metadata and restores groups/accounts in one SQLite transaction. Legacy v1 backups remain readable; missing old group metadata restores the affected accounts ungrouped with an explicit notice. Encryption or database failures abort recovery instead of reporting partial success. The encryption envelope, KDF and existing database schema are unchanged. Version 2 payloads require Authly 0.3.11 or newer to import.
Bumps the app to 0.3.11 and documents the release in CHANGELOG.md and SECURITY.md.
Validation:
npm run verify: passed on Windows, 19 files and 93 tests; format, lint, TypeScript, production build and real Electron smoke.electron-builder --win dir --x64 --publish never; launched its Authly.exe with isolated smoke storage and observedPACKAGED_AUTHLY_0.3.11_SMOKE_READY.npm audit: 0 vulnerabilities;git diff --check: passed.Release plan: after GitHub Windows/Linux CI and CodeQL pass, merge this PR and push v0.3.11 to run the existing Windows NSIS/Linux AppImage+deb release pipeline.