harden: two latent gaps in the lost-password confirmation — whitespace-only name, and U+200B still untypable #336
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found by the review of #334 (#334 (comment)). Both are unreachable in the product today. Filed because the first becomes live on a change elsewhere, and this confirmation guards a route that destroys a wallet with no password.
confirmKey(" ") === "" === confirmKey(""), and there is no separate empty-input guard. Unreachable today because both rename paths (src/popup/views/settings.js:153,src/popup/views/home.js:360) doinput.value.trim()and require a truthy result, and creation always namesWallet N. It becomes live the moment a wallet name is settable from anywhere that does not trim — an import path, a migration, a restored blob.\s, and HTML does not collapse it either, so a name containing a zero-width space remains untypable — the same class as the defect #312 fixed. Self-inflicted and escapable by renaming, unlike the original, which is why it is not a blocker.Tab, newline and U+00A0 are all handled correctly, and name collision is harmless: the delete target is
lostPasswordIndex, fixed when the screen opens (src/popup/views/deleteWallet.js:191), so the typed name is a check rather than a selector and two wallets sharing aconfirmKey()cannot cause the wrong wallet to be destroyed.Definition of done
make checkgreen.