Commit eaae085
fix(sdk-core): wire resolveEffectiveTxParams into EddsaMPCv2Utils
What changed:
- eddsaMPCv2.ts signRequestBase: replaced the vulnerable
`params.txParams || { recipients: [] }` fallback with
`resolveEffectiveTxParams(txRequest, params.txParams, this.baseCoin.getChain())`.
resolveEffectiveTxParams throws InvalidTransactionError when recipients
cannot be resolved and the intent is not a recognised no-recipient type.
- wallet.ts signTransactionTss: removed the EdDSA MPCv2 special-case block
that pre-fetched the txRequest and called txParamsFromIntent before handing
off to signTxRequest. This pre-fetch was introduced to work around the
missing guard; now that resolveEffectiveTxParams owns intent-based
derivation inside signRequestBase (which already fetches the txRequest
when given a string ID), the wallet-layer duplication is redundant.
- Removed the now-unused txParamsFromIntent import from wallet.ts.
- Tests: added resolveEffectiveTxParams guard suite to signTxRequest.ts
covering the stakingAuthorize attack vector (throws), empty-recipient
txParams (throws), allowlisted intentTypes deactivate/consolidate (pass),
intent-sourced recipients (pass), and staking intent with stakingRequestId
(pass).
Why:
Trail of Bits finding TOB-BITGOEDMPC-1 (WCI-1100): the EdDSA MPCv2 re-sign
path silently substituted an empty-recipients object when txParams was absent.
Several coin-level verifyTransaction implementations (SOL, VET, Tempo, TRON)
skip output-matching validation when recipients.length is 0, allowing a
compromised BitGo server to present a malicious txHex that signs without any
client-side validation. ECDSA already used resolveEffectiveTxParams for
fail-closed behaviour (ecdsaMPCv2.ts:958,965 and ecdsa.ts:821,828); this
change ports the same pattern to EdDSA MPCv2. MPCv1 (eddsa.ts) is explicitly
out of scope per ticket WCI-1111.
Ticket: WCI-1111
Session-Id: 94a72c0d-fce8-4672-a6a4-26df25a64dfc
Task-Id: 76f4312b-c52c-4478-94f6-457913e8c0b71 parent 3db2886 commit eaae085
3 files changed
Lines changed: 132 additions & 15 deletions
File tree
- modules
- bitgo/test/v2/unit/internal/tssUtils/eddsaMPCv2
- sdk-core/src/bitgo
- utils/tss/eddsa
- wallet
Lines changed: 130 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
9 | 11 | | |
| |||
419 | 421 | | |
420 | 422 | | |
421 | 423 | | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
422 | 552 | | |
423 | 553 | | |
424 | 554 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
50 | 51 | | |
51 | 52 | | |
52 | 53 | | |
| |||
553 | 554 | | |
554 | 555 | | |
555 | 556 | | |
556 | | - | |
| 557 | + | |
557 | 558 | | |
558 | 559 | | |
559 | 560 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
58 | 57 | | |
59 | 58 | | |
60 | 59 | | |
| |||
5059 | 5058 | | |
5060 | 5059 | | |
5061 | 5060 | | |
5062 | | - | |
5063 | | - | |
5064 | | - | |
5065 | | - | |
5066 | | - | |
5067 | | - | |
5068 | | - | |
5069 | | - | |
5070 | | - | |
5071 | | - | |
5072 | | - | |
5073 | | - | |
5074 | | - | |
5075 | 5061 | | |
5076 | 5062 | | |
5077 | 5063 | | |
| |||
0 commit comments