Repository navigation
fix(wp): remove sjcl fallback in eddsa mpcv2 and screen v1 cipher mode - #10070
Conversation
SJCL reads the cipher mode from the envelope and implements the weak OCB2 mode. BitGo only wrote CCM, so refuse any other explicit mode before SJCL runs, in both the browser and Node paths. An absent mode still defaults to CCM. Ticket: WCN-3831
Without a bitgo instance the recovery helpers called sjcl.decrypt directly, skipping the 100,000 iteration cap the main decrypt path enforces. Screen iter and mode before SJCL runs. Signatures are unchanged. Ticket: WCN-3831
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
|
@claude review |
|
Claude finished @pranavjain97's task in 22s —— View job Review of #10070No blocking issues. The change does what the title says, and I found no other raw What I checked
Minor suggestions (non-blocking)
I haven't run the tests here. |
Move the iter cap and ccm-only mode check into one sdk-core helper used by the EdDSA recovery fallback and sdk-api decrypt, so the two cannot drift. Drop a flaky timing assertion and cover non-integer iter and non-object input in tests. Ticket: WCN-3831
|
|
SJCL strips all whitespace before decoding, so a key like "it er" is iter to SJCL but unknown to JSON.parse, which let a hostile iter or mode past the guards. Read the envelope with sjcl.json.decode instead, in the shared helper used by sdk-api and the EdDSA recovery fallback. Ticket: WCN-3831
Reject hostile v1 envelopes before they reach SJCL.
bitgopassed): enforce the 100,000 iter cap and ccm-only mode.decryptV1WithFallback: reject any explicit mode other thanccm, in browser and Node.No signature changes. BitGo only wrote CCM with iter 10,000, so real keycards are unaffected.
Ticket: WCN-3831