Repository navigation
test(sdk-coin-evm): cover fail-closed EVM TSS verification paths - #9975
ralph-bitgo[bot] wants to merge 1 commit into
Conversation
|
|
113db66 to
3110d8a
Compare
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.
What: add acceptance suites for the fail-closed verifier. The sdk-coin-evm suite runs every handler on kavaevm (legacy) and hbarevm (EIP-1559): INFOSEC-671 cases (mismatched destination / value / calldata and missing recipients flagged, contractCall/customTx rejected), TOB approve-under-transfer, ERC-20 wrong to and non-zero value, ERC-7984 confidentialTransfer, fillNonce, unhandled intent types, the pending-approval path via resolveEffectiveTxParams with a stored intent (payment redirect / inflated value / swapped calldata, defi-* intents verified without a silent skip), and the strictTssVerification / onVerificationWarning reporting contract. The sdk-coin-bsc suite covers batcher-contract flows on tbsc: native and token batch arrays, batcher to, and approve(batcher, MAX) versus approve(attacker, MAX). Why: the verifier changes what EVM TSS signing accepts; the audit findings (TOB-BITGOEDMPC-2 / INFOSEC-671) and their pending-approval and legacy-chain variants need regression coverage so the checks cannot silently regress. Ticket: CECHO-2460 Session-Id: 22db0dc1-cf47-40e2-b717-1bb226a6304c Task-Id: a8a26387-a332-4be1-aab5-f39deddfc502
3110d8a to
b6da112
Compare
|
Superseded by #10121, which carries the whole CECHO-2460 stack as three commits against |
What
Acceptance suites for the fail-closed EVM TSS verifier:
sdk-coin-evmtssVerification.ts(runs onkavaevm, legacy non-EIP-1559, andhbarevm, EIP-1559):onVerificationWarningby default, throw understrictTssVerification);contractCall/customTxreject outright in both modes.approve(attacker, MAX)disguised as atransfer/paymentflagged.to/valuemismatches keep throwing; exact dAppto/value/dataequality; ERC-20 wrongto, non-zero value, tampered inner recipient/amount (existing checks throw); ERC-7984confidentialTransferrecipient-only; batch calldata under a single recipient;tokenApprovalnon-max allowance / non-approve calldata / native value / wrongto;fillNoncedeviations; unhandled intent types (acceleration,bridgeFunds,enableToken,defiRedeem,stakeWithCallData) flagged instead of silently passing.resolveEffectiveTxParams(txRequest, undefined)+ stored intent: redirect and inflated value throw through the existing native checks, swapped calldata flags; storeddefi-approve/defi-deposit/defi-withdrawintents verify with intent-mappeddefiParams(tampered amounts rejected — no silent skip);defi-redeemflagged.onVerificationWarningpayload contract (decoded vs expectedto/value/data).sdk-coin-bsctssBatcherVerification.ts(tbsc has a real statics batcher): nativebatch(address[],uint256[])and tokenbatchTransferFrom(address,address[],uint256[])happy paths and mismatches (swapped inner recipients, inflated value, wrongto, wrong token), selector pinning (0xc00c4e9e/0x4885b254), andtokenApprovalapprove(batcher, MAX)vsapprove(attacker, MAX).Why
The verifier changes what EVM TSS signing accepts (TOB-BITGOEDMPC-2 / INFOSEC-671). The audit cases and their pending-approval, batch, legacy-chain and statics-gap variants need regression coverage so the checks cannot silently regress.
Test plan
BitGo SDKCI green on the head rebased onto current master. Current counts including part 4's additions: sdk-coin-evm 124, sdk-coin-bsc 56.Stack
This PR is part 3 of 4; review and merge in order:
master)CECHO-2460-evm-tss-fail-closed-handlers-pt1)CECHO-2460-evm-tss-fail-closed-handlers-pt2) ← you are hereCECHO-2460-evm-tss-fail-closed-handlers-pt3)Ticket: CECHO-2460