bug: mnemonics should never be converted to a string; `@metamask/eth-hd-keyring` converts it to a string in its `deserialize` method
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 413
- Forks
- 308
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 253
Description
Example call:
https://github.com/MetaMask/core/blob/2b8c61d2346c144154a7735782d6dffce3a387e8/packages/keyring-controller/src/KeyringController.ts#L2434
Related issue: https://github.com/MetaMask/accounts/issues/250
In the extension's `metamask-controller.js`'s `submitPassword` function we call `keyringController.submitPassword(password)` which calls its own `restoreSerializedKeyrings` method. This eventually calls into `@metamask/eth-hd-keyring`'s `deserialize` method, which ultimately converts the `mnemonic` to a string.
Here is a trace:

Related Slack conversation: https://consensys.slack.com/archives/C087GPTR5HQ/p1741974188846359?thread_ts=1741795570.164739&cid=C087GPTR5HQ
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the KeyringController.ts call at line 2434 and trace restoreSerializedKeyrings through @metamask/eth-hd-keyring's deserialize method. Confirm where mnemonic is converted to a string and identify the relevant tests or fixtures; done means deserialization preserves the mnemonic without string conversion and the affected tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100