Wallet name with ':' corrupts file format, persistent panic on every startup

Component: ghost-eye @ ee23e6b, src/components/wallet/add_account.rs + rename_account.rs (no name validation), src/components/wallet/accounts.rs:228-233 (write) and :236-252 (read).

Description: The wallet-keys storage format is name:0x<seed-hex> per line, parsed with line.find(":"). Wallet names are not validated on add/rename (grep for character validation in add_account.rs/rename_account.rs = empty). If a name contains :, parsing on the next startup takes the wrong seed slice β†’ hex::decode fails β†’ .expect(...) panics β†’ the app crashes every time it opens until the file is edited manually.

Impact: Persistent local DoS of the TUI (self-inflicted; user must hand-edit the file to recover). No privilege escalation or fund loss.

Reproduction: Read accounts.rs:236-252; replicate the parse logic in a local unit test with input name:with:colon:0x<seed> β†’ hex::decode gets the wrong slice β†’ panic on .expect (parse PoC verified by the team).

Severity: Low. Reason: triggered by the user’s own input (or social engineering to get the user to name a wallet with :); impact is local availability only; trivial fix.

Recommendation: Validate wallet names (reject : and newlines) on add/rename; switch the file format to JSON/CSV with escaping; replace .expect on file read with error handling that skips bad lines + logs a warning.

Verification: VERIFIED.

2 Likes