Repository navigation
fix(sdk-core): bind attestation notations to verified certification - #10153
Conversation
|
@claude review always |
|
|
c7d3bd7 to
2f8894a
Compare
Certification binding is now enforced when reading attestation notations. Share-proof subkey binding signatures are now verified. Ticket: WCI-2164
2f8894a to
21bcd49
Compare
|
@claude review |
There was a problem hiding this comment.
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:
verifyShareProofnow checks the subkey binding withproofSubkeys.verify(null), so clock skew no longer causes a false rejection.getVerifiedCertificationsnow 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
verifyCertificateis called (keys pinned to the issuer,nulldate). 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.
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.
|
@claude review |
There was a problem hiding this comment.
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 ofotherCertifications[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.
Summary
Bind attestation notation reads to the verified certification.
Linear: WCI-2164
Changes
Test Plan
cd modules/sdk-core && yarn build && yarn unit-test && yarn lintcd modules/bitgo && yarn build && yarn lintplus targetedyarn mocha test/v2/unit/tss/common.ts test/v2/unit/internal/opengpgUtils.ts