Skip to content

fix(sdk-core): bind attestation notations to verified certification - #10153

Merged
vibhavgo merged 1 commit into
masterfrom
WCI-2164-verify-hsm-attestation-certifications
Nov 12, 2026
Merged

vibhavgo merged 1 commit into
masterfrom
WCI-2164-verify-hsm-attestation-certifications

Conversation

@vibhavgo

Copy link
Copy Markdown
Contributor

Summary

Bind attestation notation reads to the verified certification.

Linear: WCI-2164

Changes

  • Verify third-party certifications against the pinned issuer before reading attestation notations
  • Verify the share-proof subkey binding signature against the primary key
  • Add regression tests for both checks

Test Plan

cd modules/sdk-core && yarn build && yarn unit-test && yarn lint
cd modules/bitgo && yarn build && yarn lint plus targeted yarn mocha test/v2/unit/tss/common.ts test/v2/unit/internal/opengpgUtils.ts

@linear-code

linear-code Bot commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

WCI-2164

@vibhavgo

Copy link
Copy Markdown
Contributor Author

@claude review always

@github-actions

github-actions Bot commented Nov 10, 2026 •

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

@vibhavgo
vibhavgo force-pushed the WCI-2164-verify-hsm-attestation-certifications branch from c7d3bd7 to 2f8894a Compare November 10, 2026 10:04
Certification binding is now enforced when reading attestation notations.

Share-proof subkey binding signatures are now verified.

Ticket: WCI-2164
@vibhavgo
vibhavgo force-pushed the WCI-2164-verify-hsm-attestation-certifications branch from 2f8894a to 21bcd49 Compare November 10, 2026 11:11
@vibhavgo

Copy link
Copy Markdown
Contributor Author

@claude review

@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.

I re-reviewed the latest push and didn't find any new bugs. Both earlier inline points look addressed in the code. Because this changes OpenPGP signature verification in the TSS/MPC flows of sdk-core, a human look would still be worthwhile.

What was reviewed:

  • verifyShareProof now checks the subkey binding with proofSubkeys.verify(null), so clock skew no longer causes a false rejection.
  • getVerifiedCertifications now returns only certifications that carry notations, so a proof whose only verified certification has no notations is rejected by both callers. New tests cover this case and the foreign-certification cases.
  • Checked how verifyCertificate is called (keys pinned to the issuer, null date). An unverified certification that carries notations makes the helper return null, which both callers treat as failure.
Extended reasoning...

The change touches OpenPGP verification of share proofs and wallet signatures in modules/sdk-core (opengpgUtils.ts and tss/common.ts), plus new unit tests in modules/bitgo. This is security-sensitive crypto code used by the TSS/MPC signing flows. The new commit addresses both inline findings from the earlier review: the binding check now skips date checks, and certifications without notations are no longer returned as verified. Since the change is in crypto verification logic in a core module, it warrants human review rather than automated approval.

@vibhavgo
vibhavgo marked this pull request as ready for review November 10, 2026 13:04
@vibhavgo
vibhavgo requested review from a team as code owners November 10, 2026 13:04

@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.

@Charan-Ratlan

Copy link
Copy Markdown
Contributor

@claude review

@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.

Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.

Additional findings (outside the current diff — GitHub can't attach inline comments there):

  • 🟡 modules/sdk-core/src/bitgo/tss/common.ts — nit: Maintainers reading the comment above the HSM signature check will see the logic this PR removed, described as the security argument. The comment at common.ts:282-284 still says validity follows from "any of the results from calling verifyPrimaryUser" being valid. The code no longer calls verifyPrimaryUser. Fix: reword it to say the signature is trusted because the fingerprints differ and every notation-bearing certification verifies against bitgoPub via getVerifiedCertifications, with notations read from the first verified one.

    Why this was flagged

    No runtime trigger; this is a comment-accuracy nit. The comment at modules/sdk-core/src/bitgo/tss/common.ts:282-284 explains the check as "that any of the results from calling verifyPrimaryUser is valid". The diff replaced that call with getVerifiedCertifications(primaryUser, bitgoPub) at common.ts:290. The old some(valid) check plus a read of otherCertifications[0] is exactly the weakness this PR fixes. So the comment now documents the reasoning the PR proved unsafe. A maintainer who trusts the comment could put that pattern back. On the base branch the comment matched the code.

    Verification: Lines 282-284 of modules/sdk-core/src/bitgo/tss/common.ts still say validity follows because "any of the results from calling verifyPrimaryUser is valid". This diff removes the verifyPrimaryUserWrapper(walletSignature, bitgoPub, false) call and its .some((result) => result.valid) check. The comment therefore describes a check that is gone. Only documentation is affected and runtime behavior does not change.

@vibhavgo
vibhavgo merged commit 9ca732b into master Nov 12, 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