fix(abstract-eth,sdk-core): enforce signableHex/serializedTxHex consistency for BSC and XDC (WCI-1398) - #9526
Draft
Marzooqa wants to merge 2 commits into
Draft
fix(abstract-eth,sdk-core): enforce signableHex/serializedTxHex consistency for BSC and XDC (WCI-1398)#9526Marzooqa wants to merge 2 commits into
Marzooqa wants to merge 2 commits into
Conversation
…stency for BSC and XDC For TSS_VERIFY_USE_SERIALIZED_TX_HEX coins (BSC, XDC), the ECDSA MPCv2 signing flow calls verifyTransaction with serializedTxHex but then signs signableHex. Both values are server-supplied independently, allowing a malicious server to pair a benign serializedTxHex (shown to verify) with a tampered signableHex (what actually gets signed). Adds a CoinWithSignableConsistency interface to sdk-core, implemented by AbstractEthLikeNewCoins. After verifyTransaction succeeds, ecdsaMPCv2 calls assertSignableConsistency to derive the expected signableHex from serializedTxHex and throw InvalidTransactionError if they diverge. WCI-1398 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> TICKET: WCI-1398
Contributor
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.
Summary
TSS_VERIFY_USE_SERIALIZED_TX_HEXcoins (BSC, XDC), the ECDSA MPCv2 signing flow callsverifyTransactionwithserializedTxHexbut signssignableHex. Both are server-supplied independently, so a malicious server can pair a benignserializedTxHex(verified by the client) with a tamperedsignableHex(what actually gets signed).CoinWithSignableConsistencyinterface +isCoinWithSignableConsistencyguard tosdk-core, following the same pattern asCoinWithPreHashedSignable.AbstractEthLikeNewCoinsimplements the interface viaassertSignableConsistency, which parsesserializedTxHexusing ethereumjs, derives the expectedsignableHex, and throwsInvalidTransactionErrorif they diverge.ecdsaMPCv2.tscallsassertSignableConsistencyafterverifyTransactionsucceeds in theshouldVerifyWithSerializedTxHexbranch.Test plan
assertSignableConsistency— consistent pair passes (no throw)assertSignableConsistency— tamperedsignableHexfrom a different tx (different destination address) throws"signableHex is inconsistent with serializedTxHex: possible server tampering"40 passing182 passingRelated
Closes WCI-1398. Part of Trail of Bits audit (TOB-BITGOEDMPC-3) remediation.
🤖 Generated with Claude Code