fix(tss): require txParams with recipients for TSS tx signing#8462
Open
mrdanish26 wants to merge 1 commit intomasterfrom
Open
fix(tss): require txParams with recipients for TSS tx signing#8462mrdanish26 wants to merge 1 commit intomasterfrom
mrdanish26 wants to merge 1 commit intomasterfrom
Conversation
63ddf05 to
346f349
Compare
346f349 to
b04cdf0
Compare
Contributor
pranavjain97
requested changes
Apr 10, 2026
| txRequest.apiVersion === 'full' ? txRequest.transactions![0].unsignedTx : txRequest.unsignedTxs[0]; | ||
|
|
||
| if (!params.txParams?.recipients?.length) { | ||
| throw new Error('txParams with recipients is required for TSS transaction signing'); |
Contributor
There was a problem hiding this comment.
this should be an Invalid and let's make the error more UI friendly
Comment on lines
+739
to
+741
| if (!params.txParams?.recipients?.length) { | ||
| throw new Error('txParams with recipients is required for TSS transaction signing'); | ||
| } |
| const txRequest = await this.tssUtils!.recreateTxRequest(txRequestId, decryptedPrv, reqId); | ||
| const pendingApprovalRecipients = this._pendingApproval.info?.transactionRequest?.recipients; | ||
| const txParams = pendingApprovalRecipients?.length ? { recipients: pendingApprovalRecipients } : undefined; | ||
| const txRequest = await this.tssUtils!.recreateTxRequest(txRequestId, decryptedPrv, reqId, txParams); |
Contributor
There was a problem hiding this comment.
whats the behavior here if txParams is undefined?
Contributor
Author
There was a problem hiding this comment.
If txParams is undefined, recreateTxRequest still calls signTxRequest with txParams omitted. For ECDSA transaction signing, the SDK then throws error because recipients are required for verification—same guard as when callers omit txParams elsewhere. It’s only “optional” at the recreateTxRequest call site when the pending approval has no transactionRequest.recipients; downstream ECDSA tx signing rejects that instead of defaulting to empty recipients.
2245b20 to
ab5753e
Compare
ab5753e to
2be89f5
Compare
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
signTxRequest()silently defaultedtxParamsto{ recipients: [] }when the caller omitted it, allowing a compromised BitGo API to swapsignableHexto redirect funds without client detectionsignRequestBase()that throws whentxParams.recipientsis absent or empty forRequestType.tx, ensuringverifyTransaction()always receives explicit caller-supplied paramstxParamsthroughrecreateTxRequest()so the pending-approval re-sign path keeps working; extracts recipients frompendingApproval.info.transactionRequestTest plan
signTxRequestinecdsaMPCv2/signTxRequest.tsandecdsa.tsupdated to passtxParamswith recipientstxParamsis missingtxParams.recipientsis an empty arrayyarn unit-testinmodules/bitgo