Repository navigation
fix(sdk-core): harden ECDSA challenge re-sign verification - #10157
Merged
mohammadalfaiyazbitgo merged 1 commit intoNov 11, 2026
Merged
Conversation
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
There was a problem hiding this comment.
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.
Contributor
Contributor
|
|
s84krish
approved these changes
Nov 11, 2026
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.
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
EcdsaUtilsgains three helpers:getEcdhPubKeyFromXprv— derives the verifying pubkey from the admin's decrypted xprv. A server-suppliedderivedPubKeyis never used as the trust anchor for a signature check.isChallengeSignedByEcdhKeypair— checks the storedverifiers.adminSignatureagainst 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.resignEnterpriseChallengesnow verifies against the xprv-derived key instead of the WP-suppliedderivedPubKey, 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).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 viauploadAndEnableTssEcdsaSigning(withoutchallenge) instead.Enterprise.getExistingTssEcdsaChallenge(returns an unverified challenge) and thechallengeparam ofuploadAndEnableTssEcdsaSigning(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-suppliedderivedPubKeythat 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-suppliedderivedPubKey, missing/empty/garbage signature rejection, HSM-match rejection for both HSMs, and three invalid-proof rejections.TICKET: WCN-4180