Skip to content

test(sdk-coin-evm): cover fail-closed EVM TSS verification paths - #9975

Closed
ralph-bitgo[bot] wants to merge 1 commit into
CECHO-2460-evm-tss-fail-closed-handlers-pt2from
CECHO-2460-evm-tss-fail-closed-handlers-pt3
Closed

ralph-bitgo[bot] wants to merge 1 commit into
CECHO-2460-evm-tss-fail-closed-handlers-pt2from
CECHO-2460-evm-tss-fail-closed-handlers-pt3

Conversation

@ralph-bitgo

@ralph-bitgo ralph-bitgo Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

What

Acceptance suites for the fail-closed EVM TSS verifier:

  • sdk-coin-evm tssVerification.ts (runs on kavaevm, legacy non-EIP-1559, and hbarevm, EIP-1559):
    • INFOSEC-671 cases: mismatched destination, mismatched value, mismatched calldata and missing recipients each flagged (warn + onVerificationWarning by default, throw under strictTssVerification); contractCall / customTx reject outright in both modes.
    • TOB-BITGOEDMPC-2: approve(attacker, MAX) disguised as a transfer / payment flagged.
    • Payment shapes: native to/value mismatches keep throwing; exact dApp to/value/data equality; ERC-20 wrong to, non-zero value, tampered inner recipient/amount (existing checks throw); ERC-7984 confidentialTransfer recipient-only; batch calldata under a single recipient; tokenApproval non-max allowance / non-approve calldata / native value / wrong to; fillNonce deviations; unhandled intent types (acceleration, bridgeFunds, enableToken, defiRedeem, stakeWithCallData) flagged instead of silently passing.
    • Pending-approval path built with resolveEffectiveTxParams(txRequest, undefined) + stored intent: redirect and inflated value throw through the existing native checks, swapped calldata flags; stored defi-approve / defi-deposit / defi-withdraw intents verify with intent-mapped defiParams (tampered amounts rejected — no silent skip); defi-redeem flagged.
    • Statics-gap paths (no configured batcher on kavaevm/hbarevm) flagged, and the onVerificationWarning payload contract (decoded vs expected to/value/data).
  • sdk-coin-bsc tssBatcherVerification.ts (tbsc has a real statics batcher): native batch(address[],uint256[]) and token batchTransferFrom(address,address[],uint256[]) happy paths and mismatches (swapped inner recipients, inflated value, wrong to, wrong token), selector pinning (0xc00c4e9e / 0x4885b254), and tokenApproval approve(batcher, MAX) vs approve(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

  • sdk-coin-evm and sdk-coin-bsc suites green; BitGo SDK CI green on the head rebased onto current master. Current counts including part 4's additions: sdk-coin-evm 124, sdk-coin-bsc 56.
  • Pending: prod backtest replaying ~563k EVM TSS payments from the last 90 days through the verifier, expecting no unexplained rejection of legitimate payments. Release gate tracked on CECHO-2460; not reproducible in CI.

Stack

This PR is part 3 of 4; review and merge in order:

  1. fix(sdk-core): carry TSS intent and strict policy to verifyTransaction #9972 — sdk-core intent + strict policy plumbing (base: master)
  2. fix(abstract-eth): fail-closed EVM TSS handlers for verifyTssTransaction #9973 — abstract-eth fail-closed verifier (base: CECHO-2460-evm-tss-fail-closed-handlers-pt1)
  3. test(sdk-coin-evm): cover fail-closed EVM TSS verification paths #9975 — verification test suites (base: CECHO-2460-evm-tss-fail-closed-handlers-pt2) ← you are here
  4. fix(abstract-eth): verify EVM TSS payments against declared asset #10114 — caller-declared intent and asset binding (base: CECHO-2460-evm-tss-fail-closed-handlers-pt3)

Ticket: CECHO-2460

@linear-code

linear-code Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

CECHO-2460

@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Compatibility checks are failing on Node.js 27-nightly (experimental, non-blocking). This does not block merge, but it signals an incompatibility to fix before this release becomes supported.

View run

@dpkjnr
dpkjnr force-pushed the CECHO-2460-evm-tss-fail-closed-handlers-pt3 branch from 113db66 to 3110d8a Compare November 3, 2026 07:01
@dpkjnr
dpkjnr marked this pull request as ready for review November 3, 2026 10:35
@dpkjnr
dpkjnr requested a review from a team as a code owner November 3, 2026 10:35

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
@dpkjnr
dpkjnr force-pushed the CECHO-2460-evm-tss-fail-closed-handlers-pt3 branch from 3110d8a to b6da112 Compare November 3, 2026 10:49
@dpkjnr

dpkjnr commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Superseded by #10121, which carries the whole CECHO-2460 stack as three commits against master. Its tree is byte-identical to the head of #10114, so this PR's changes, part 3 (verification test suites), are all there. The stack couldn't land piece by piece: #9972 relaxes the DeFi recipient guard that #9973's handlers rely on, and #10114 rewrote the core of #9973. Closing in favor of #10121; the branch is kept.

@dpkjnr dpkjnr closed this Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants