Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7f62357. Configure here.
Contributor
Author
|
@metamaskbot publish-preview |
Contributor
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
tanguyenvn
approved these changes
Sep 21, 2026
lionellbriones
approved these changes
Sep 21, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
userHandle→ PRF passkey migration flow.cancelPasskeyReplacementto remove an in-flight replacement and its linked authentication ceremony.Changes
generatePasskeyReplacementRegistrationOptionscompletePasskeyReplacementcancelPasskeyReplacementTest plan
userHandle→ PRF migration.yarn workspace @metamask/passkey-controller run jest --no-coverage src/PasskeyController.test.tsReferences
JIRA
Checklist
Note
High Risk
Changes touch passkey enrollment, vault-key wrapping, and atomic record replacement—security-critical paths where a bug could lock users out or leave inconsistent state.
Overview
Adds a userHandle → PRF migration path in
@metamask/passkey-controllerso legacy enrolled passkeys can be upgraded without leaving the wallet unprotected mid-flow.New API:
generatePasskeyReplacementRegistrationOptions(PRF-onlycreate()options, excludes the current credential),completePasskeyReplacement(verify registration + post-registration PRF auth, re-wrap the vault key, atomically swap the record), andcancelPasskeyReplacement(drop one in-flight replacement and its linked post-registration auth ceremony). The old record stays usable until completion succeeds.Safety and ceremony behavior: PRF output is mandatory for migration (
prf_required); stale or changed source records are rejected (replacement_source_changed,migration_not_required). Registration ceremonies carryisReplacement/sourceCredentialId; post-registration auth ceremonies link back viaregistrationChallenge, with cleanup on expiry, capacity eviction, and registration delete. Password or vault-key export failures happen before ceremony teardown so clients can retry the same WebAuthn responses. Enrollment logic is refactored into shared verify/derive/save helpers, with credential ID checks on authentication.Docs, changelog, messenger action types, and broad tests cover success, rollback, concurrency, and cancellation.
Reviewed by Cursor Bugbot for commit c6cdff1. Bugbot is set up for automated code reviews on this repo. Configure here.