Repository navigation
feat: read enrolled recovery identifiers and bind escrow challenges to the profile - #11149
Conversation
325168d to
8e5ddad
Compare
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
cc92526 to
3d6bb9b
Compare
|
@metamaskbot publish-preview |
|
Partly-written escrows lead to a stuck update (design, medium) MfaRecoveryController.ts A accepts. |
|
The approval is the same for every getIdentifiers call MfaRecoveryController.ts The request hash is the same constant for every call. It has no request ID or nonce, unlike getRecoverySecret. Anyone who captures one of these low-assurance approvals can replay it until it expires and read the user's enrolled identifiers (emails, passkeys, wallet addresses). That's a privacy leak, not a way to take over the account. The fix is to include a randomId() in the hash, as the other operations do. |
|
Identifier order causes false "replica corruption" errors |
|
nits get hashed, which can cause another false corruption error; |
|
The mutation approval is now sent to more places. The request-bound AAL2 approval now also goes to generateChallenge and getIdentifiers. Each additional endpoint that receives the bearer token is another place it can leak or be replayed (for example, into logs or intermediaries). This is worth calling out in the threat model. |
|
The code and its docs disagree on which escrows get SIWE proofs. The applyMutation docs in types.ts say each escrow gets "one proof per SIWE identifier the escrow has not enrolled". The code instead computes one list for all escrows: any wallet missing from any escrow is proven to every escrow. The stub rejects an extra proof for an already-enrolled identifier (Exactly one enrolled identifier authorization required). It only gets away with it because the stub replays an already-applied mutation before checking proofs. Either compute proofs per escrow, or fix the docs and make sure the real escrow ignores extra proofs. |
|
One lookup failure blocks the whole write. #findNewSiweIdentifiers uses Promise.all over getIdentifiers, so if any remaining escrow's lookup fails, the write aborts with that raw error instead of an MfaRecoveryError. It also doesn't check that each escrow's returned version equals expectedVersion, which would catch a version mismatch before asking for an approval and wallet signatures. |
1 similar comment
|
One lookup failure blocks the whole write. #findNewSiweIdentifiers uses Promise.all over getIdentifiers, so if any remaining escrow's lookup fails, the write aborts with that raw error instead of an MfaRecoveryError. It also doesn't check that each escrow's returned version equals expectedVersion, which would catch a version mismatch before asking for an approval and wallet signatures. |
|
getIdentifiers ignores a pending mutation. It returns an epoch even when a mutation is in flight. A caller who builds updateIdentifiers from that result then hits pending_mutation. Consider rejecting, or returning the current phase alongside the result. |
this is addressed in: #11200 |
i think this is acceptable. Reading identifiers using an aal1 token is fine. We can change the authorization model for this API in the wasm if needed. Let's wait for the auditors' findings. The proposed fix on the client side wouldn't work |
Not applicable to the current escrow: it preserves the submitted identifier order through validation, storage, and reads. Since every replica receives the same ordered array, no canonical sort is needed. |
fixed here |
fixed here |
Failing the write on a lookup failure is intentional, and Cubist already normalizes those errors. Earlier version checks are useful, but must distinguish conflicts from already-applied mutations; #11200 adds that reconciliation handling. |
Reads are intentionally allowed while a mutation is pending. Callers can use |
) ## Explanation Stacked on MetaMask#11149. SIWE wallets prove control themselves (Auth doesn't vouch for them). - `applyMutation` takes `IdentifierAuthorization[]`, sharing one challenge per escrow. - Each SIWE identifier an escrow hasn't enrolled gets a proof, including at `register`. SIWE is exempt from the `approvedIdentifiers` check. ## References - Escrow: consensys-vertical-apps/cubist-secret-escrow#7 ## Checklist - [x] I've updated the test suite for new or updated code as appropriate - [x] I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate - [x] I've communicated my changes to consumers by updating changelogs for packages I've changed - [ ] I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them --------- Co-authored-by: Cursor <cursoragent@cursor.com>
Explanation
Stacked on #10883. Adds
getIdentifiers()and profile-bound challenges.getIdentifiers(): AAL1 read returning enrolled identifiers at the highest escrow version (epoch) plus Auth's identifiers. Use it to buildupdateIdentifiers.generateChallengetakes the operation's approval.References
Checklist