Repository navigation
fix(sdk-coin-eth): strictly verify the multisig enable-token sendMultiSig operation (CECHO-2815) - #10200
Merged
nvrakesh06 merged 1 commit intoNov 23, 2026
Conversation
Contributor
Contributor
|
|
nvrakesh06
force-pushed
the
nvrakeshreddy/cecho-2815-bitgojs-multisig-enable-token-path
branch
7 times, most recently
from
November 19, 2026 12:34
090dd9a to
971d3df
Compare
…iSig operation (CECHO-2815) The multisig branch of Erc7984Token.verifyEnableTokenTransaction compared only txPrebuild.buildParams.recipients — client-attached echo data built by Wallet.buildTokenEnablements from the caller's own enableTokens — so the operation the user actually signs was never inspected. Onchain-multisig users sign the sendMultiSig operation hash over txPrebuild.recipients[0] (address, amount, data), never over txHex, and the MultiSigV3 contract enforces at execution that the broadcast args hash to that op: a compromised platform could serve any recipient (attacker contract with native value, ERC-20 approve theft, or a delegate substitution) and the user would first-sign it. Strict flow: bind the signed recipient in full — 1. sendMultiSig native value must be 0; 2. the recipient data must decode fail-closed as a delegation calldata (rejects approve/transfer and smuggled inner calls); 3. aclMulticall shape must target the ACL contract (the forwarder shape is bound on-chain by onlyParent plus the enforced callFromParent target/value); 4. verifyStrictEnableTokenCalldata binds delegate == pinned enterprise viewing key, future expiry, and an exact deduplicated match against the requested tokens (CECHO-2720 helper, unchanged); 5. when the prebuild carries a txHex, its sendMultiSig args must mirror the recipient — a diverging (decoy) txHex is rejected. Gate — non-breaking by construction: Flipt flag multisig-enable-token-strict-verification, delivered by the platform as the typed prebuild field multisigEnableTokenStrictVerification. The legacy flow is the default: absent or false keeps it; only an explicit true enables the strict flow. Bumping this SDK into any deployment before the platform stamps the field is therefore a no-op — behavior is byte-for-byte the pre-fix flow. Activation (stamping true by default) is the platform-side follow-up; flipping the Flipt flag to false is the runtime kill switch once active. Purpose-scoped: one declared field for this one check, no generic flag map on SDK types. Tests: 14 multisig strict-path cases — benign both delegation shapes (flag enabled by the platform), txHex mirror pass, value theft, approve theft, delegate substitution, smuggled inner call, wrong ACL target, callFromParent theft shape, decoy txHex, non-sendMultiSig txHex, missing recipient, and the legacy-default proofs: an absent flag and an explicit false both keep a fully hostile prebuild verifying on the legacy flow (bump-safety and kill-switch). The five legacy-path tests run with no flag on the prebuild — the exact shape the SDK sees before the platform-side change. sdk-coin-eth 592 passing, abstract-eth 188 passing.
nvrakesh06
force-pushed
the
nvrakeshreddy/cecho-2815-bitgojs-multisig-enable-token-path
branch
from
November 23, 2026 05:44
971d3df to
9113b40
Compare
nvrakesh06
marked this pull request as ready for review
November 23, 2026 05:53
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.
nayandas190
approved these changes
Nov 23, 2026
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.
Description
Fixes the client-side verification gap from CECHO-2815: the multisig branch of
Erc7984Token.verifyEnableTokenTransactionvalidated onlytxPrebuild.buildParams.recipients— client-attached echo data thatWallet.buildTokenEnablementsbuilds from the caller's ownenableTokens— so the operation the user actually signs was never inspected.What actually gets signed (the fix's binding target): onchain-multisig users sign the
sendMultiSigoperation hash overtxPrebuild.recipients[0](address, amount, data) — never overtxHex(Eth.signTransaction→getOperationSha3ForExecuteAndConfirmhashes the platform-supplied recipient verbatim;halfSignedcarries notxHex), and the MultiSigV3 contract enforces at execution that the broadcast args hash to that op. Sorecipients[0]is the single authoritative binding, and the strict flow verifies it in full:sendMultiSignative value must be0(blocks direct native-fund theft).decodeDelegationCallsFromCalldata, CECHO-2720): rejects any other selector (e.g. an ERC-20approve(attacker, …)theft prebuild) and any smuggled non-delegation inner call.aclMulticallshape must target the ACL contract; thecallFromParent(forwarder) shape is bound on-chain by the forwarder'sonlyParentmodifier plus the enforcedcallFromParenttarget/value — same decision as the TSS path.verifyStrictEnableTokenCalldata(CECHO-2720 helper, unchanged) binds delegate == pinned enterprise viewing key (fail closed when unpinned), future expiry, and an exact deduplicated match against the requested tokens.txHex, itssendMultiSigargs must mirror the recipient exactly: a diverging (decoy)txHexthat passes verification while different args get signed is rejected.Gate — non-breaking by construction: Flipt flag
multisig-enable-token-strict-verification, delivered by the platform as the typed prebuild fieldTransactionPrebuild.multisigEnableTokenStrictVerification. The legacy flow is the default: absent orfalsekeeps it; only an explicittrueenables the strict flow. Consequently this PR changes nothing for any deployment until the platform opts in — when the version is bumped into Wallet Platform before the platform-side change lands, prebuilds carry no field and behavior is byte-for-byte the pre-fix flow. The contract is declared once in the type system (compiler-checked on both ends, no prototype-chain or narrowing tricks), purpose-scoped to this one check — there is no generic flag map on SDK types, and any future flag needs its own reviewed field.Sequencing:
multisigEnableTokenStrictVerification: trueon ERC-7984 enable-token prebuilds → strict activates everywhere; flipping the Flipt flag tofalse(or dropping the stamp) is the runtime kill switch, per request, no SDK redeploy.zamaViewingKeyAddresspins for mainnet + Hoodi in BitGoJS statics (strict fails closed without them), and staging validation of real prebuild shapes (recipients[0].datapresence, ACL target shapes).Until step 2 ships, the SDK behaves as the legacy flow and the ticket's vulnerability remains open in the field — activation is the platform change.
Issue Number
CECHO-2815 (related: CECHO-2720, CECHO-2719)
Type of change
How Has This Been Tested?
Unit tests — 14 multisig strict-path cases in
modules/sdk-coin-eth/test/unit/erc7984Token.ts:aclMulticallshape) passes when the platform enables the flagcallFromParentshape) passestxHexpassessendMultiSigvalue rejected (native fund theft)approvetheft prebuild rejected (non-delegation calldata)aclMulticallshape targeted away from the ACL contract rejectedcallFromParenttheft shape (forwarder → attacker contract with funds) rejectedtxHexwhosesendMultiSigargs differ from the signed recipient rejectedtxHexthat is not asendMultiSigenvelope rejectedfalsekeeps the legacy flowThe five legacy-path tests run with no flag on the prebuild (the default shape).
Full-module runs:
modules/sdk-coin-eth592 passing,modules/abstract-eth188 passing — zero failures. Reproduce:cd modules/sdk-coin-eth && npx mocha.Checklist