Skip to content

fix(sdk-core): harden ECDSA challenge re-sign verification - #10157

Merged
mohammadalfaiyazbitgo merged 1 commit into
masterfrom
WCN-4180/verify-enterprise-challenge-resign
Nov 11, 2026
Merged

mohammadalfaiyazbitgo merged 1 commit into
masterfrom
WCN-4180/verify-enterprise-challenge-resign

Conversation

@mohammadalfaiyazbitgo

@mohammadalfaiyazbitgo mohammadalfaiyazbitgo commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

What

Hardens the re-sign flows for enterprise ECDSA (TSS) challenges, with particular attention to legacy GG18-era enterprise configurations. The admin's ECDH key now only re-signs a challenge whose stored attestation it can verify locally.

Behavior

  • EcdsaUtils gains three helpers:
    • getEcdhPubKeyFromXprv — derives the verifying pubkey from the admin's decrypted xprv. A server-supplied derivedPubKey is never used as the trust anchor for a signature check.
    • isChallengeSignedByEcdhKeypair — checks the stored verifiers.adminSignature against that xprv-derived key.
    • verifyEnterpriseChallengeForResign — throws unless (1) the stored admin signature was made by the caller's own ECDH key, (2) the challenge does not match either BitGo HSM challenge, and (3) both ntilde proofs verify.
  • resignEnterpriseChallenges now verifies against the xprv-derived key instead of the WP-supplied derivedPubKey, and skips re-signing when the enterprise challenge matches one of the BitGo HSM challenges being re-signed (the old keychain legitimately signed those during setup, so a signature alone cannot distinguish them).
  • New Enterprise.resignTssEcdsaChallenge(userPassword): fetches the existing enterprise challenge, verifies it, then re-signs the enterprise and BitGo HSM challenges with the admin's ECDH key. If verification fails, admins generate a fresh challenge via uploadAndEnableTssEcdsaSigning (without challenge) instead.
  • Deprecated: Enterprise.getExistingTssEcdsaChallenge (returns an unverified challenge) and the challenge param of uploadAndEnableTssEcdsaSigning (signs without verification). 4-arg callers resolve to a non-deprecated overload and see no change.

Tests

  • modules/bitgo/test/v2/unit/enterprise.ts (9 passing): upload called with verified signatures; WP-supplied derivedPubKey that does not match the xprv is rejected (regression); replayed HSM challenge as the enterprise challenge is rejected (regression); unverified challenge uploads nothing.
  • modules/bitgo/test/v2/unit/internal/tssUtils/ecdsa.ts (25 passing for the touched describes): acceptance, tamper rejection, wrong-key rejection with a matching WP-supplied derivedPubKey, missing/empty/garbage signature rejection, HSM-match rejection for both HSMs, and three invalid-proof rejections.

TICKET: WCN-4180

Strengthens the re-sign flows for enterprise ECDSA (TSS) challenges, with
particular attention to legacy GG18-era enterprise configurations.

- EcdsaUtils adds getEcdhPubKeyFromXprv, isChallengeSignedByEcdhKeypair and
  verifyEnterpriseChallengeForResign: the verifying pubkey is derived from the
  admin's decrypted xprv (rather than a server-supplied derivedPubKey), the
  challenge must not match a BitGo HSM challenge, and both ntilde proofs must
  pass verification before any re-signing takes place.
- resignEnterpriseChallenges now verifies against the xprv-derived key instead
  of the WP-supplied derivedPubKey, and skips re-signing when the enterprise
  challenge matches one of the BitGo HSM challenges.
- New Enterprise.resignTssEcdsaChallenge verifies then re-signs the existing
  enterprise and BitGo HSM challenges. getExistingTssEcdsaChallenge and the
  challenge param of uploadAndEnableTssEcdsaSigning are deprecated in favor
  of the verifying flows.

TICKET: WCN-4180

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@linear-code

linear-code Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

WCN-4180

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Compatibility checks are failing on Node.js 27-nightly (experimental, non-blocking). This does not block merge, but it signals an incompatibility to fix before this release becomes supported.

View run

@mohammadalfaiyazbitgo
mohammadalfaiyazbitgo merged commit 6a32872 into master Nov 11, 2026
28 checks passed
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.

2 participants