fix(github): enforce persona/pubkey match and verify against server-computed payload - #112
Open
prasanna8585 wants to merge 1 commit into
Open
prasanna8585 wants to merge 1 commit into
prasanna8585 wants to merge 1 commit into
Conversation
…omputed payload Two coupled issues in the GitHub validator: 1. The public key recovered from the Gist's persona field (payload.Persona) was never asserted to match the avatar key supplied in the upload request (gh.Pubkey). 2. The final signature check used payload.SignPayload -- content taken directly from the attacker-controlled Gist -- instead of gh.SignaturePayload, the payload the server itself computes (line 88) and expects to have been signed. Fix: assert the recovered pubkey matches the request's declared pubkey via crypto.CompressedPubkeyHex, and verify the signature against the server-computed gh.SignaturePayload rather than the Gist-supplied value.
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
Two coupled issues in the GitHub validator (
validator/github/github.go):personafield (payload.Persona) was never asserted to match the avatar key supplied in the upload request (gh.Pubkey, from the embeddedvalidator.Base).payload.SignPayload-- content taken directly from the attacker-controlled Gist -- instead ofgh.SignaturePayload, the payload the server itself computes (line 88,gh.GenerateSignPayload()) and expects to have been signed.Together, this allows an account owner to attach a self-signed but forged
sign_payload(arbitraryuuid/created_at/prevvalues) to their own GitHub proof, corrupting metadata written to the proof chain and Arweave. Per platform review, this does not allow cross-account takeover or persistent metadata beyond the reporter's own persona.Fix
crypto.CompressedPubkeyHex.gh.SignaturePayload(already computed at line 88, just previously unused for verification) rather than the Gist-supplied value.