Skip to content

fix(sdk-lib-mpc): authenticate signatureR in DKLS DSG round 4 messages#8470

Draft
mrdanish26 wants to merge 1 commit intomasterfrom
fix/wal-376-dkls-dsg-signaturer-authentication
Draft

fix(sdk-lib-mpc): authenticate signatureR in DKLS DSG round 4 messages#8470
mrdanish26 wants to merge 1 commit intomasterfrom
fix/wal-376-dkls-dsg-signaturer-authentication

Conversation

@mrdanish26
Copy link
Copy Markdown
Contributor

Summary

  • Sign signatureR bytes with the party GPG key in encryptAndAuthOutgoingMessages() — previously hardcoded signature: "" left the ECDSA nonce commitment R unauthenticated (F-04, severity: HIGH)
  • Verify signatureR in decryptAndVerifyIncomingMessages() before returning it to callers
  • Transmit signatureRSignature in getSignatureShareRoundThree() so the server can authenticate R before passing it to combinePartialSignatures()

Test plan

  • 86/86 sdk-lib-mpc unit tests pass
  • 144/144 sdk-core unit tests pass
  • New tests: sign+verify round-trip, tampered R rejection, wrong-key rejection, no-signatureR passthrough

Ticket: WAL-376

🤖 Generated with Claude Code

signatureR was wrapped with signature: "" (hardcoded empty string) in
encryptAndAuthOutgoingMessages(), leaving the ECDSA nonce commitment R
unauthenticated. A MITM could substitute a crafted R value and have it
used by combinePartialSignatures() to produce an attacker-controlled
signature component.

Fix:
- Sign signatureR bytes with the party GPG key via detachSignData in
  encryptAndAuthOutgoingMessages()
- Verify signatureR in decryptAndVerifyIncomingMessages() and return it
  in the result so callers can use the authenticated value
- Transmit signatureRSignature in getSignatureShareRoundThree() so the
  server can authenticate signatureR before combining
- Update signBitgoMPCv2Round3 (server simulation) to pass signatureR
  to decryptAndVerifyIncomingMessages for end-to-end verification
- Add unit tests covering sign, verify, tamper detection, and
  wrong-key rejection for signatureR

Ticket: WAL-376

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@linear
Copy link
Copy Markdown

linear bot commented Apr 9, 2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant