fix: add SRP validation during import#39679
Conversation
Builds ready [4c4052d]
UI Startup Metrics (1306 ± 121 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs [🚨 Warning! Bundle size has increased!]
|
Gudahtt
left a comment
There was a problem hiding this comment.
LGTM, though Cursor raises a good point that there is still room for improvement here (though we could handle that later)
@Gudahtt it displays the message |
Builds ready [ec94c66]
UI Startup Metrics (1311 ± 105 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Builds ready [7b61e03]
UI Startup Metrics (1368 ± 126 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Builds ready [673cc65]
UI Startup Metrics (1314 ± 103 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
…k/metamask-extension into gar/fix/import-valid-srp
Builds ready [b30832b]
UI Startup Metrics (1488 ± 136 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
✨ Files requiring CODEOWNER review ✨🧪 @MetaMask/qa (1 files, +2 -1)
🔐 @MetaMask/web3auth (1 files, +1 -5)
|
Builds ready [9240cf7]
UI Startup Metrics (1391 ± 117 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Builds ready [a506f53]
UI Startup Metrics (1306 ± 112 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Builds ready [d008b7a]
UI Startup Metrics (1354 ± 83 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
| await onboardingSrpPage.checkPageIsLoaded(); | ||
|
|
||
| await onboardingSrpPage.fillSrp(wrongSeedPhrase); | ||
| await onboardingSrpPage.clickConfirmButtonWithSrpError(); |
There was a problem hiding this comment.
The check is done on the fly and the button is kept disabled until a valid SRP is entered
Builds ready [ed6f480]
UI Startup Metrics (1400 ± 106 ms)
📊 Page Load Benchmark ResultsCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Description
Fixes a validation bug where invalid SRPs could be added during the post-onboarding flow. While the initial wallet setup properly rejects invalid SRPs, the add-wallet flow was accepting phrases like "broccoli" repeated 12 times, still generating addresses without proper validation.
Changelog
CHANGELOG entry: add SRP validation during import
Related issues
Fixes: None
Manual testing steps
broccoli broccoli broccoli broccoli broccoli broccoli broccoli broccoli broccoli broccoli broccoli broccoliScreenshots/Recordings
Before
After
Onboarding with SRP
Screen.Recording.2026-02-02.at.11.00.01.AM.mov
Import SRP
Screen.Recording.2026-02-02.at.10.59.05.AM.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes SRP import validation on a core onboarding/post-onboarding path; a bug could incorrectly block valid phrases or allow regressions in error/enablement behavior.
Overview
Prevents importing SRPs that use valid BIP39 words but fail checksum validation.
SrpInputImportnow runsisValidMnemonicbefore propagating the phrase to parents; when the checksum is invalid it clears the value, disables continuation, and shows a dedicatedinvalidSeedPhraseNotFounderror (srp-input-import__invalid-checksum-error).Onboarding import flow and tests were updated to rely on the input component for checksum validation (removing the redundant
isValidMnemoniccheck inonboarding-flow/import-srp), and E2E/unit tests were adjusted/added to assert the new error message and disabled confirm behavior (including a new invalid-checksum test case and snapshot/test name updates).Written by Cursor Bugbot for commit ed6f480. This will update automatically on new commits. Configure here.