fix(tss): verify recipients before signing#8539
Open
mrdanish26 wants to merge 1 commit intomasterfrom
Open
Conversation
…x substitution TICKET: WAL-375
e444156 to
2d64d76
Compare
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.
TICKET: WAL-375
Description
Ensures
verifyTransactionalways receives recipient details before any signing material is sent to BitGo, preventing a compromised API from silently substitutingsignableHexwith attacker-controlled bytes.A
resolveEffectiveTxParams()guard is added to both ECDSA and MPCv2signRequestBase()paths. It resolves recipients from three sources in priority order:txParams.recipients— normal case.txRequest.intent.recipients— fallback for smart-contract interactions (e.g. TemposupplyController) where native ETH amount = 0 sobuildParamsis empty but intent carries the recipients.tokenApproval,acceleration,fillNonce,bridgeFunds,consolidate,transferToken) — guard skipped;verifyTransactionhandles validation internally.Shared logic is extracted to
tss/ecdsa/base.ts(NO_RECIPIENT_TX_TYPES+resolveEffectiveTxParams) to avoid duplication between the two signing paths.A previous PR (#8462) hard-threw on any empty recipients, breaking cases 2 and 3. It was reverted in #8538. This PR supersedes it.
Type of change
Testing
Added 4 new unit tests to each signing path (8 total):
signTxRequestshould succeed when recipients are only in intent — validates intent fallbacksignTxRequestshould succeed for no-recipient tx types (tokenApproval) — exemptionsignTxRequestshould succeed for no-recipient tx types (acceleration) — exemptionsignTxRequestshould prefertxParams.recipientsoverintent.recipientswhen both present — priority