Skip to content

fix: onboarding completion page guard#40012

Merged
lwin-kyaw merged 1 commit intomainfrom
fix/onboarding-completion-guard
Feb 13, 2026
Merged

fix: onboarding completion page guard#40012
lwin-kyaw merged 1 commit intomainfrom
fix/onboarding-completion-guard

Conversation

@lwin-kyaw
Copy link
Contributor

@lwin-kyaw lwin-kyaw commented Feb 12, 2026

Description

Users can bypass the entire onboarding flow by navigating directly to the completion route (#/onboarding/completion), rendering the CreationSuccessful component without having created a wallet. Clicking "Open wallet" then calls completeOnboarding(), marking onboarding as complete even though the KeyringController vault was never created. This leads to an inconsistent state where the extension appears onboarded but has no wallet, causing errors when trying to unlock.

This PR adds a guard to the CreationSuccessful component that checks whether the wallet has been initialized (isInitialized). If the wallet is not initialized and the user is not arriving from a settings reminder, they are redirected back to the onboarding welcome page. This prevents users from skipping mandatory onboarding steps by directly manipulating route URLs.

Open in GitHub Codespaces

Changelog

CHANGELOG entry: Fixed a security issue where users could skip onboarding by navigating directly to the completion route

Related issues

Fixes: #37079

Manual testing steps

  1. Load the extension in Chrome and begin a fresh onboarding (clear extension data if needed)
  2. Instead of going through the onboarding flow, navigate directly to chrome-extension://<extension-id>/home.html#/onboarding/completion
  3. Verify that you are redirected back to the onboarding welcome page instead of seeing the "Your wallet is ready!" screen
  4. Complete the normal onboarding flow (create password, back up SRP, etc.)
  5. Verify the completion screen renders correctly after proper onboarding
  6. After onboarding, go to Settings → Security & Privacy → Reveal Secret Recovery Phrase → back up SRP again
  7. Verify the completion screen renders correctly when arriving from the settings reminder flow (?isFromReminder=true)

Screenshots/Recordings

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@lwin-kyaw lwin-kyaw requested a review from a team as a code owner February 12, 2026 12:27
@github-actions
Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@metamaskbot metamaskbot added the team-onboarding Onboarding team label Feb 12, 2026
@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 12, 2026

✨ Files requiring CODEOWNER review ✨

🔐 @MetaMask/web3auth (2 files, +33 -0)
  • 📁 ui/
    • 📁 pages/
      • 📁 onboarding-flow/
        • 📁 creation-successful/
          • 📄 creation-successful.test.tsx +18 -0
          • 📄 creation-successful.tsx +15 -0

@metamaskbotv2
Copy link
Contributor

metamaskbotv2 bot commented Feb 12, 2026

Builds ready [115ac3c]
UI Startup Metrics (1392 ± 96 ms)
PlatformBuildTypePageMetricMean (ms)Min (ms)Max (ms)Std Dev (ms)P 75 (ms)P 95 (ms)
ChromeBrowserifyStandard HomeuiStartup1392117416479614511557
load119899514468912471343
domContentLoaded119199014398912421329
domInteractive271692192484
firstPaint171661183161207330
backgroundConnect24722534416251274
firstReactRender1592531722
initialActions106113
loadScripts96075712118910111103
setupStore147150141521
numNetworkReqs231589201581
BrowserifyPower User HomeuiStartup193414291048196718202666
load11791045182917111761640
domContentLoaded11631033177416511551610
domInteractive36191723033123
firstPaint1747648786227303
backgroundConnect4442877685776336634
firstReactRender23154962633
initialActions103112
loadScripts92279914971569061352
setupStore1674471930
numNetworkReqs72431763175162
WebpackStandard HomeuiStartup801652106296861975
load69258591691759856
domContentLoaded68758291090753849
domInteractive241580162171
firstPaint1175733558153210
backgroundConnect24165572838
firstReactRender1492741820
initialActions102112
loadScripts68458090889749846
setupStore1163851121
numNetworkReqs2315103221586
WebpackPower User HomeuiStartup1232894216619413051589
load7076161292124694997
domContentLoaded6986101281124681992
domInteractive39182823737124
firstPaint1356155779143305
backgroundConnect16013032040162256
firstReactRender22173132427
initialActions101011
loadScripts6956081271122679982
setupStore1243751418
numNetworkReqs1174429351147214
FirefoxBrowserifyStandard HomeuiStartup15281322213517015641921
load13181128192813713761589
domContentLoaded13171124192213713701589
domInteractive66332103687136
firstPaint------
backgroundConnect5431126155586
firstReactRender1291711213
initialActions102012
loadScripts12921106189913513471556
setupStore146123151340
numNetworkReqs241297221785
BrowserifyPower User HomeuiStartup26922004409136228903294
load15351331242722215832031
domContentLoaded15341331242722215832030
domInteractive12635651106119392
firstPaint------
backgroundConnect2641101013190298786
firstReactRender18156351823
initialActions2047522
loadScripts14901311239820615321901
setupStore1648695202248656
numNetworkReqs73361603292129
WebpackStandard HomeuiStartup15871307237417216212024
load13671189172411014201575
domContentLoaded13661188172411014191575
domInteractive882923045128156
firstPaint------
backgroundConnect60273725262133
firstReactRender15105061420
initialActions103112
loadScripts1336117516709913951499
setupStore146176201246
numNetworkReqs231387201779
WebpackPower User HomeuiStartup26581966377641327953685
load15431208245630016562294
domContentLoaded15421208245030016552293
domInteractive14032733156118540
firstPaint------
backgroundConnect3071171205262281923
firstReactRender20155552328
initialActions216123
loadScripts15061187243428516252120
setupStore1877784231263726
numNetworkReqs69361653494132
📊 Page Load Benchmark Results

Current Commit: 115ac3c | Date: 2/12/2026

📄 Localhost MetaMask Test Dapp

Samples: 100

Summary

  • pageLoadTime-> current mean value: 1.03s (±40ms) 🟡 | historical mean value: 1.04s ⬇️ (historical data)
  • domContentLoaded-> current mean value: 718ms (±35ms) 🟢 | historical mean value: 728ms ⬇️ (historical data)
  • firstContentfulPaint-> current mean value: 76ms (±13ms) 🟢 | historical mean value: 79ms ⬇️ (historical data)

📈 Detailed Results

Metric Mean Std Dev Min Max P95 P99
pageLoadTime 1.03s 40ms 1.01s 1.31s 1.07s 1.31s
domContentLoaded 718ms 35ms 699ms 979ms 741ms 979ms
firstPaint 76ms 13ms 56ms 184ms 84ms 184ms
firstContentfulPaint 76ms 13ms 56ms 184ms 84ms 184ms
largestContentfulPaint 0ms 0ms 0ms 0ms 0ms 0ms
Bundle size diffs [🚨 Warning! Bundle size has increased!]
  • background: 2.75 KiB (0.06%)
  • ui: 31 Bytes (0%)
  • common: 5.58 KiB (0.05%)

@tuna1207
Copy link
Member

tuna1207 commented Feb 12, 2026

I think we should also add guard to completeOnboarding() in case other pages can trigger this method

completeOnboarding(): boolean {

@lwin-kyaw lwin-kyaw enabled auto-merge February 12, 2026 14:27
@lwin-kyaw lwin-kyaw added this pull request to the merge queue Feb 13, 2026
Merged via the queue into main with commit b30fb20 Feb 13, 2026
188 of 193 checks passed
@lwin-kyaw lwin-kyaw deleted the fix/onboarding-completion-guard branch February 13, 2026 05:21
@github-actions github-actions bot locked and limited conversation to collaborators Feb 13, 2026
@metamaskbot metamaskbot added the release-13.20.0 Issue or pull request that will be included in release 13.20.0 label Feb 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-13.20.0 Issue or pull request that will be included in release 13.20.0 size-S team-onboarding Onboarding team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Sentry] Error: KeyringController - The operation cannot be completed while the controller is locked.

4 participants