Repository navigation
Conversation
Adopt the current vault keys as a stable vault key set, sealed for the password and for the Recovery Secret in their own metadata partitions, with a control record holding the password namespace auth key. - Add authenticateForRecovery and the non-persisted recoverySession state for the aal2 recovery verifier session - Add migrateToEnvelope with a resumable, encrypted checkpoint - Change the password of envelope-managed vaults by resealing the vault keys and swapping the password OPRF key under the metadata lock - Open the password envelope first in syncLatestGlobalPassword and submitGlobalPassword - Bump @metamask/auth-network-utils to ^0.4.0 Co-authored-by: Cursor <[email protected]>
…in fetchAllSecretData Open the envelope sealed for the password before falling back to the password's own keys, so a new device can restore after an envelope password change. Co-authored-by: Cursor <[email protected]>
…d envelope management Refactor the handling of control records in the Seedless Onboarding Controller to support multiple control records instead of a single control item. This includes changes to how control records are fetched, written, and serialized, enhancing the management of envelope states and improving the overall migration process. - Replace `ControlItem` with `ControlRecord` throughout the codebase. - Update methods to handle arrays of control records, ensuring compatibility with the new structure. - Modify the changelog to reflect the changes in how vault keys are sealed and managed under the new envelope system. This update lays the groundwork for improved envelope management and recovery processes in future implementations.
… reset actions Add new functionalities to the Seedless Onboarding Controller, including: - `recoverWithRecoverySecret`: Allows recovery of an envelope-managed vault using a Recovery Secret instead of a password, enhancing user recovery options. - `resetPasswordWithVaultKeys`: Enables setting a new global password on an unlocked, envelope-managed vault without requiring the old password. Additionally, update error handling to include new messages related to recovery processes and adjust the changelog to reflect these changes. This update improves the overall user experience during vault recovery and password management.
…recovery processes Refactor the Seedless Onboarding Controller to streamline the migration to envelope encryption. Key changes include: - Simplified `migrateToEnvelope` method to eliminate the need for a password during migration, allowing the current password to derive the vault keys directly. - Updated handling of control records to support multiple records and improve envelope management. - Introduced new error handling for recovery processes, including clearer messaging for envelope-related issues. - Adjusted tests to reflect changes in the migration process and ensure proper functionality. These enhancements improve user experience during vault recovery and password management, aligning with ongoing efforts to optimize the onboarding process.
…ality and error handling This update introduces improvements to the `resetPasswordWithVaultKeys` action within the Seedless Onboarding Controller. Key changes include: - Clarified conditions under which the password can be reset, specifically requiring a valid aal2 session and ensuring the local password is not synced. - Added new error messages, including `PasswordResetRequiresRecovery`, to provide clearer feedback during the password reset process. - Updated documentation and tests to reflect these changes, ensuring robust error handling and user guidance. These enhancements aim to streamline the password management experience and improve overall user interaction with the recovery process.
…and update dependencies This commit introduces significant changes to the Seedless Onboarding Controller, focusing on the handling of envelope keys. Key updates include: - Replaced the `deriveEnvelopeKeys` function with `deriveTestEnvelopeKeys` to standardize envelope key derivation across the codebase. - Updated various methods to utilize the new envelope key structure, ensuring consistency in how keys are managed and accessed. - Adjusted tests to reflect these changes, enhancing the reliability of the testing suite. - Updated the `yarn.lock` file to reflect changes in package dependencies. These modifications aim to improve the overall architecture of the envelope management system and streamline the onboarding process for users.
…carding pending envelope migration This update introduces a new behavior in the `recoverWithRecoverySecret` action, ensuring that any pending envelope migration checkpoint is discarded when a vault is restored using the Recovery Secret. Additionally, tests have been added to verify that the recovery session is maintained while the pending migration is cleared. Documentation has been updated to reflect these changes, improving clarity around the recovery process and its implications for envelope management.
…tarball Co-authored-by: Cursor <[email protected]>
|
@metamaskbot publish-preview |
…package.json` and update its reference in `yarn.lock` to use a local tarball instead of a portal link. This change ensures consistency in package management and resolves potential issues with package resolution.
| checksum: 10/2714a70eae53a1f46d293980c71a1ed2f59708247019444154e71fc15328e78ec95287ffc2d954a29f903224a1a9fe4d69fb17724e9039bcefd240752f1df26c | ||
| checksum: 10/3b7d596185f54672f4e024f9088a70876ba59b036c1375da0e9f5dbcd2f44d81f81eaaa4b4eb9dbde6d74864c49a261a4960b044053364c64261fd80bf0fa270 | ||
| languageName: node | ||
| linkType: hard |
There was a problem hiding this comment.
Gitignored tarball breaks dependency install
High Severity
Removing the portal resolution makes Yarn resolve @metamask/toprf-secure-backup from metamask-toprf-secure-backup-1.1.0.tgz. That archive is excluded by the root *.tgz gitignore and is not in this commit, so yarn install fails for CI and anyone without the local file.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit a8247e6. Configure here.
…gration behavior Added documentation to the `SeedlessOnboardingControllerMigrateToEnvelopeAction` type, specifying that any pending envelope migration checkpoint will be discarded when this action is called, as it pertains to the vault being replaced. This enhances clarity regarding the migration process and its implications for existing checkpoints.
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
…troller - Introduced `recoverWithRecoverySecret` action to restore vault keys using a Recovery Secret without creating a local vault. The vault keys are held in memory until `setLocalPassword` is called. - Added `setLocalPassword` action to create a local vault with the recovered keys, marking the password as outdated until a global password is set. - Implemented `resetPasswordWithVaultKeys` action to set a new global password without the old password after recovery. - Introduced new error messages for various recovery and password reset scenarios. - Updated documentation and tests to reflect these changes. This enhances the onboarding process by providing more flexible recovery options and better password management for users. [#11220](#11220)
- Changed the state variable from `isPasswordResetPending` to `isLocalPassword` to better reflect the vault's password status. - Updated related methods and documentation to align with the new state variable, ensuring that password management actions correctly handle the local password scenario. - Adjusted tests to verify the new behavior regarding password resets and local vault management. This refactor enhances clarity in the password management logic and improves the onboarding experience for users. [#11220](#11220)
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
|
@metamaskbot publish-preview |
|
The "Publish preview" workflow has been updated to a new version that uses OIDC for authentication. Please use the new workflow instead of this one. To trigger the new workflow, go to the Publish a preview build workflow, click "Run workflow", and enter |
…dlessOnboardingController tests
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |
…date fetchAllSecretData behavior BREAKING CHANGE: `fetchAllSecretData` no longer takes a password as an argument.
…ngEnvelopeStatus type - Introduced `getEnvelopeStatus` function to derive envelope-related flags from the controller state. - Added `SeedlessOnboardingEnvelopeStatus` type to encapsulate the derived flags. - Updated `SeedlessOnboardingController` to utilize the new function for state checks. - Removed unused `enabled` fields from control records across various tests to streamline data handling. - Added tests for `getEnvelopeStatus` to ensure correct flag derivation based on different state scenarios.
…d state management - Updated the migration process to ensure the Recovery Secret envelope is written before the control record, preventing incomplete migrations. - Enhanced the `restoreVaultWithPassword` method to clear `isLocalPassword` and `envelope` state when the vault is not envelope-managed. - Added logic to maintain a `pendingEnvelopeMigration` checkpoint for resuming migrations. - Improved test cases to reflect changes in migration behavior and state management, ensuring robust handling of envelope-related scenarios. - Cleaned up comments and documentation for clarity on the migration process and state transitions.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 3 total unresolved issues (including 2 from previous reviews).
❌ 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 e6a2abb. Configure here.
… onboarding controller
… onboarding controller
… onboarding controller
…envelope-main Co-authored-by: Cursor <[email protected]>
|
@metamaskbot publish-preview |
|
Preview builds have been published. Learn how to use preview builds in other projects. Expand for full list of packages and versions. |


Explanation
Envelope-managed vaults let a user recover their secret data with a Recovery Secret instead of the global password, and let the password change without re-encrypting the vault keys.
This PR adds:
src/envelope/):EnvelopeStorepersists encrypted envelope and control records in their own metadata partitions.envelope-keysderives and seals/opens the envelope keys.pending-migrationcheckpoints an in-flight migration so a failed call can be retried with the same bytes.migrateToEnvelopemakes the current vault keys the stable vault key set, seals them for the Recovery Secret, and writes a control record. Secret data items and the vault itself are unchanged. The firstchangePasswordafter migration writes the password envelope.authenticateForRecoverystarts an aal2 recovery session (src/mfa-recovery/recovery-session.ts, held in non-persistedrecoverySessionstate).recoverWithRecoverySecretopens the Recovery Secret envelope, fetches secret data, and creates a local vault under a new password. Until that password is synced or reset, it is treated as outdated.resetPasswordWithVaultKeyssets a new global password on an unlocked, envelope-managed vault after a Recovery Secret recovery. It is only allowed whileenvelope.passwordAuthPubKeyis unset and with a valid aal2 session.changePassword,syncLatestGlobalPassword,submitGlobalPassword,fetchAllSecretData, andcheckIsPasswordOutdatednow read envelope state first and fall back to the existing key chain when no envelope exists. Envelope-managed vaults are restored infetchAllSecretData.EnvelopeStateandRecoverySessiontypes, all exported fromsrc/index.ts.Recovery flow:
References
Checklist
Note
High Risk
Large changes to vault encryption, password sync, and MFA recovery touch secret handling and include a breaking
fetchAllSecretDataAPI change.Overview
Adds envelope-managed vaults for seedless onboarding: stable vault keys (
K_v) sealed separately for password and Recovery Secret, with control records in metadata (EnvelopeStore/envelope-keys).New messenger flows include
authenticateForRecovery(aal2recoverySession),migrateToEnvelope,recoverWithRecoverySecret(local vault +isLocalPassword),resetPasswordWithVaultKeys(global password without the old one), andgetEnvelopeStatus. PersistedenvelopeandisLocalPasswordstate track management mode and post-recovery passwords.Breaking:
fetchAllSecretDatano longer accepts a password and only decrypts using the unlocked vault without mutating local vault or envelope state. Password-based restore moves torestoreVaultWithPassword({ password }).Changed: Envelope-aware
changePassword,syncLatestGlobalPassword,submitGlobalPassword, andcheckIsPasswordOutdated; legacy password rotation is blocked when control records exist.envelopeis excluded from state logs. Tests/helpers and@metamask/superstruct/ local TOPRF tarball dependency updates support the new paths.Reviewed by Cursor Bugbot for commit 091416c. Bugbot is set up for automated code reviews on this repo. Configure here.