fix: correct auditor-key claims in THREAT_MODEL.md and circuit comments - #134
Open
tech-adrian wants to merge 1 commit into
Open
fix: correct auditor-key claims in THREAT_MODEL.md and circuit comments#134tech-adrian wants to merge 1 commit into
tech-adrian wants to merge 1 commit into
Conversation
#133's threat model listed "auditor scoping" as an enforced property of the compliance and disclosure circuits, and both circuits carried a comment claiming a Poseidon2 hash provides "auditor-scoped binding, so a disclosure produced for one auditor cannot be replayed as though it were addressed to another." Neither claim was accurate as stated: - The hash (`_disclosure_commitment` / `_binding`) is never asserted against anything -- it's dead. Removing it changes the compiled bytecode (verified: `auditor_key` becomes an unused parameter and the artifact hash changes), so it stays in place rather than being deleted; only the comment claiming it does work was wrong. - The anti-redirect property the comment describes is real, but it comes from `auditor_key` being a `pub` argument -- any public input is bound into the proof's verification, independent of this hash -- not from the hash itself. - Neither the circuit nor the compliance contract checks that `auditor_key` corresponds to a real, registered auditor. There is no auditor registry; a prover may set it to any Field value. Corrected both circuit comments to state the actual mechanism, and renamed the dead value so it doesn't imply a security property. Added an "Auditor-key binding" section to THREAT_MODEL.md, moved the registry gap into External assumptions for both circuit rows (matching the pattern the doc already used elsewhere), and added a bullet to Residual assumptions pointing at #63 -- the doc's "users protect their own secrets" assumption currently glosses over a real app-level bug where a closed tab during deposit confirmation can strand a note with no recoverable secret. Verified the fix is a no-op cryptographically: bb write_vk against the recompiled bytecode produces byte-identical VKs to the committed ones for both circuits, so no proof fixtures, deployed VKs, or frontend circuit artifacts need to change. 145 contract tests and 140 frontend tests pass unchanged.
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
#133's threat model listed "auditor scoping" as an enforced property of the compliance and disclosure circuits, and both circuits carried a comment claiming a Poseidon2 hash provides that binding. Neither claim was accurate as stated:
_disclosure_commitment/_binding) is never asserted against anything — it's dead code. I verified removing it changes the compiled bytecode (auditor_keybecomes an unused parameter and the artifact hash changes), so it stays in place rather than being deleted. Only the comment claiming it does cryptographic work was wrong.auditor_keyafter generation — comes fromauditor_keybeing apubargument tomain. Any public input is bound into what the proof verifies against; that's independent of this specific hash.auditor_keycorresponds to a real, registered auditor. There's no auditor registry anywhere incontracts/compliance/src/lib.rs; a prover may set it to anyFieldvalue.Changes
circuits/compliance/src/main.nr,circuits/disclosure/src/main.nr: corrected comments to state the actual mechanism; renamed the dead value from_disclosure_commitment/_bindingto_auditor_key_referencedso it doesn't imply a security property it doesn't have.docs/THREAT_MODEL.md:Validation
bb write_vkagainst the recompiled bytecode for both circuits produces byte-identical VKs to the currently-committed ones — confirmed by diffing the regeneratedvkfiles againstcircuits/{compliance,disclosure}/target/vk. This is a comment/doc-only fix cryptographically; no proof fixtures, deployed VKs, or frontend circuit artifacts need to change.cargo test --workspace: 145 passed, 0 failed.pnpm test: 140 passed, 0 failed.Test plan