fix: bind BJJ signature proof signing key to issuer published state#411
Open
Alexander-frenki wants to merge 3 commits into
Open
fix: bind BJJ signature proof signing key to issuer published state#411Alexander-frenki wants to merge 3 commits into
Alexander-frenki wants to merge 3 commits into
Conversation
verifyBJJSignatureProof trusted the public key embedded in proof.issuerData.authCoreClaim and only checked that the state value was published on-chain, never verifying that the auth claim is included in that state's claims tree (issuerData.mtp was parsed but unused). An attacker could put their own key in authCoreClaim, sign with it, and forge a credential from any issuer DID that verifyProofs would accept. Bind the signing key to the published state: - state.value === poseidon(claimsTreeRoot, revocationTreeRoot, rootOfRoots) - rootFromProof(issuerData.mtp, hiAuth, hvAuth) === state.claimsTreeRoot Also verify fetched credential proofs in FetchHandler's plaintext offer and issuance-response paths before saving (previously only the encrypted path verified), so received credentials are validated, not blindly trusted. Add regression test covering a forged credential re-signed by a key not in the issuer claims tree.
vmidyllic
approved these changes
Jun 12, 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.
Summary
verifyBJJSignatureProoftrusted the public key embedded inproof.issuerData.authCoreClaimand only checked thatstate.valuewas published on-chain — it never verified that the auth claim is included in that state's claims tree (proof.issuerData.mtpwas parsed but unused). An attacker could place their own key inauthCoreClaim, sign with it, and forge a credential from any issuer DID thatverifyProofswould accept.Bind the signing key to the issuer's published state:
state.value === poseidon(claimsTreeRoot, revocationTreeRoot, rootOfRoots)rootFromProof(issuerData.mtp, hiAuth, hvAuth) === state.claimsTreeRootAlso verify fetched credential proofs in
FetchHandler's plaintext offer and issuance-response paths before saving (previously only the encrypted path verified), so received credentials are validated rather than blindly trusted.Adds a regression test covering a forged credential re-signed by a key not in the issuer's claims tree.