fix: reject zero sessionId in verifySession - #882
Merged
Conversation
The id_commitment circuit constraint is a disjunction: it holds when the commitment equals H(DS_C, mt_index, r) or when it is zero. Zero is the "no session" sentinel every Uniqueness Proof uses, and it is satisfiable by any World ID regardless of mt_index. A session record left at zero can therefore be satisfied by an arbitrary World ID with a patched authenticator, voiding the same user+RP continuity guarantee. V2 is released and immutable, so the check lands in a new WorldIDVerifierV3 that overrides verifySession. Existing deployments are remediated by upgrading the proxy to V3. Reported via HackerOne #3912490. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…3-reject-zero-session
Follows the error moving onto the V2 interface. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Dzejkop
reviewed
Aug 4, 2026
Dzejkop
reviewed
Aug 4, 2026
The fuzz test forces the 0x02 prefix and covers the same assertion, so the fixed-action case adds no coverage. Its rationale comment moves to the fuzz test. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
paolodamico
previously approved these changes
Aug 5, 2026
Prefixes the file names so V3 is not mistaken for a shipped version. Drop the prefix once it ships. Contract and interface names are unchanged, so the deployed identity and ABI are unaffected. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Dzejkop
approved these changes
Aug 5, 2026
paolodamico
approved these changes
Aug 5, 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.
verifySessionacceptssessionId == 0, which is the circuit's "no session" sentinel and is satisfiable by any World ID. A session record left at zero can therefore be satisfied by an arbitrary World ID, voiding the "same user + RP pair across requests" continuity guarantee thatverifySessionis meant to provide.Adds
WorldIDVerifierV3, which overridesverifySessionto reject a zerosessionId. Purely additive — three new files, no existing file is modified.Reported via HackerOne #3912490.
Why the sentinel is universally satisfiable
circom/client_side_proofs/oprf_nullifier.circom:183constrains the commitment as a disjunction:It is satisfied either when
id_commitment == H(DS_C, mt_index, id_commitment_r)or whenid_commitment == 0. The zero branch places no constraint onmt_index, so it is not merely "unbound" — it is provable by any identity in the tree. Every Uniqueness Proof uses that branch legitimately, so the sentinel cannot be removed from the circuit; the verifier has to reject it at the boundary instead.