Repository navigation
fix(sdk-core): assert signableHex consistency in ECDSA MPCv1 signing - #10177
Conversation
|
|
428bdce to
ee0c89b
Compare
|
@claude review |
|
Claude finished @vibhavgo's task in 33s —— View job Review of PR #10177
Verdict: looks good, with only nits. I only read the code. I did not run the tests, and I couldn't get a diff against Correctness
Nits (non-blocking)
TestsThe sdk-core tests cover four cases: the arguments passed, an abort before any share is produced, skipping for non-flag coins, and not crashing for flag coins without the method. The sdk-coin-bsc end-to-end tests use the real tbsc coin. I didn't read the bsc test diff in detail. |
ee0c89b to
92d5a04
Compare
For TSS_VERIFY_USE_SERIALIZED_TX_HEX coins (BSC/XDC), the MPCv1 signing path verified serializedTxHex and signed signableHex without binding the two fields. Adds the same assertSignableConsistency check the MPCv2 path already performs (WCI-1398) so the signed payload must be consistent with the verified transaction. Ticket: WCI-2239
92d5a04 to
57d6ffd
Compare
|
@claude review |
|
Claude finished @vibhavgo's task in 13s —— View job Review of PR #10177Verdict: the change is correct and ready to merge. Everything below is optional. I read the diff and did not run the tests. Source change (
|
There was a problem hiding this comment.
I re-reviewed the updated push and found no bugs. The as any nit is mostly fixed: the only casts left are the two reqId ones in modules/sdk-coin-bsc/test/unit/bsc.ts. Because this changes the ECDSA MPCv1 signing path, a human reviewer should still look at it.
What was reviewed:
- The new guard in
EcdsaUtils.signRequestBase. It runsassertSignableConsistencyonly in the serializedTxHex branch, afterverifyTransactionand beforesignableHexbecomes the signing payload. It matches the guard in ecdsaMPCv2.ts line for line. isCoinWithSignableConsistency. It is a plain duck-type check, so flagged coins that don't implement the method (ICP) skip the assert and don't crash.- The new sdk-core and BSC tests. Between them they cover the tampered case, the consistent case, the unflagged case and the flagged coin with no method. I read them but did not run them.
Extended reasoning...
The change adds a guarded call to assertSignableConsistency in the ECDSA MPCv1 signRequestBase (sdk-core), plus unit tests in sdk-core and sdk-coin-bsc. It closes a gap where the server could tamper with the signed payload: serializedTxHex was verified, but a separately supplied signableHex was what got signed. The edit is small and matches the existing MPCv2 guard. Even so, it sits on the TSS/MPC signing path, which counts as crypto, and modules/sdk-core is covered by CODEOWNERS (wallet-core teams). The latest commit fixed most of the earlier typing nit.
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.
Summary
Adds a signableHex/serializedTxHex consistency check to the legacy ECDSA MPCv1 signing path for
TSS_VERIFY_USE_SERIALIZED_TX_HEXcoins (BSC/XDC), matching the check the MPCv2 path already performs (WCI-1398).Linear: WCI-2239
Changes
EcdsaUtils.signRequestBase(sdk-core) now callsbaseCoin.assertSignableConsistency(serializedTxHex, signableHex)afterverifyTransactionwhenshouldVerifyWithSerializedTxHexis true and the coin implements the check — identical guard toecdsaMPCv2.tsTest Plan
cd modules/sdk-core && BITGOJS_TEST_PASSWORD=test npx mocha test/unit/bitgo/utils/tss/ecdsa/ecdsa.tscd modules/sdk-coin-bsc && BITGOJS_TEST_PASSWORD=test npx mocha test/unit/bsc.tsyarn lint-changed