Skip to content

fix(identity): stop accepting forged zero-knowledge proofs - #1078

Open
jonathanayubausara-a11y wants to merge 1 commit into
MettaChain:mainfrom
jonathanayubausara-a11y:fix/identity-zk-verification-honesty
Open

fix(identity): stop accepting forged zero-knowledge proofs#1078
jonathanayubausara-a11y wants to merge 1 commit into
MettaChain:mainfrom
jonathanayubausara-a11y:fix/identity-zk-verification-honesty

Conversation

@jonathanayubausara-a11y

Copy link
Copy Markdown

Summary

Resolves #1023. verify_zero_knowledge_proof was a length check: any 32-byte proof with verification_type == "identity_proof" passed, so a forged proof reported success, bumped the privacy nonce, and updated observable last_activity state — while PrivacyVerificationFailed implied real proof verification.

Per the issue's stated scope (making the behavior honest and safe; real ZK integration is out of scope), the chosen direction is an explicit not-implemented error:

  • verify_privacy_preserving now always fails with the new ZeroKnowledgeVerificationUnsupported error once the caller has an identity with ZK privacy enabled — it never reports success for an unverified proof, so no nonce bump or state update can be triggered by a forged proof.
  • The fake verify_zero_knowledge_proof helper is removed.
  • The direction is documented on the message itself (proofs must be verified off-chain or via a verifier-gated flow).

Verification

  • cargo test -p propchain-identity — 25 passed, including the updated privacy-preserving verification test asserting a 32-byte forged proof is rejected
  • cargo clippy -p propchain-identity --all-targets -- -D warnings — clean
  • cargo check --workspace — clean

Closes #1023

verify_privacy_preserving previously "verified" proofs with a length check
(any 32-byte proof with verification_type "identity_proof" passed), so a
forged proof reported success, bumped the privacy nonce, and updated
observable state. On-chain zero-knowledge proof verification is not
implemented in this contract, so the message now always fails with
ZeroKnowledgeVerificationUnsupported instead of pretending to verify; the
fake verify_zero_knowledge_proof helper is removed and the direction is
documented on the message.

Closes MettaChain#1023
@drips-wave

drips-wave Bot commented Aug 27, 2026

Copy link
Copy Markdown

@jonathanayubausara-a11y Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Identity zero-knowledge verification is a length check: any 32-byte proof passes verify_zero_knowledge_proof

1 participant