-
Notifications
You must be signed in to change notification settings - Fork 8
Passphrase Prompt #63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tuxpizza
wants to merge
6
commits into
main
Choose a base branch
from
passphrase-ux
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b760d6d
Add new passphrase prompt
tuxpizza 73e9566
Update text for restore
tuxpizza e955fcd
Update text for restore
tuxpizza 44dbf81
Add missing image
tuxpizza fc4f1d9
Add keyboard inset and fix padding
tuxpizza f50f4c4
Fix SafeArea
tuxpizza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Security audit finding — MEDIUM
Passphrase bottom-sheet Confirm is unguarded and the sheet is never dismissed — double-fire (or a stale re-tap) silently overwrites the wallet's encrypted .keys backup with a different mnemonic
otherf50f4c48(runeceaea44e9f0)Affected
lib/views/create_wallet.dartL271-L288lib/views/create_wallet.dartL361-L376What
Introduced by the diff. The new passphrase sheet's Confirm runs
await viewModel.createWallet()with noNavigator.popon success and no in-flight guard (LongPrimaryButton has no busy/disabled state). Two rapid taps callcreateWallet()twice concurrently: each_createWallet()generates a freshMnemonic.create(WordCount.words12), and both write the SAME*.keysfile viaFile(keys).writeAsBytesSync(last-writer-wins). The two executions then each pushNewWalletInfoScreen/WalletHomeon the root navigator, so the user is shown the first seed on the info pages while the on-disk wallet holds the second mnemonic — after restart the wallet derives keys the user never backed up. Because the modal isisDismissible: falseand never popped beforecreateWallet()pushes the next route (viaNavigator.of(c!)), the sheet with the filled, masked passphrase and a live Confirm stays mounted underneath the wallet terminal screens (NewWalletInfoScreen/WalletHomearecanPop: false, so the buried sheet is not directly reachable on success but is reachable whenever the create flow errors/retries). While the unguarded double-submit class also existed on the base's Continue button, the new sheet is a new creation entry point with the same flaw and the modal-dismissal regression is new.Remediation
In the Confirm handler, guard against concurrent execution (e.g. a
Future<bool> _creatingin-flight flag or disable the button whilecreateWallet()runs) andNavigator.pop()the sheet before/after a successfulcreateWallet(). Prefer pushing the post-creation screens only after the sheet route is removed (pop the modal, then navigate).Posted from the Cake security-audit bot. Use the ❌ False positive button in Slack if this is not a real issue.