Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: unsoundness risk in gnark 0.10 #1749

Closed
Oppen opened this issue Jan 16, 2025 · 1 comment
Closed

bug: unsoundness risk in gnark 0.10 #1749

Oppen opened this issue Jan 16, 2025 · 1 comment
Labels
audit cantina Audit report from Cantina operator

Comments

@Oppen
Copy link
Collaborator

Oppen commented Jan 16, 2025

Reported in cantina#5. Transcript:

The Batcher accepts invalid proof in gnark groth16 proving system whenever at least two commitments are used in the circuit.

This breaks the soundness of the protocol whenever the circuit uses at least two commitments. Although using more than 1 commitment is relatively rare, malicious applications can intentionally add redundant commitments and inputs to their circuits without affecting the main logic of the circuit (as shown in PoC circuit below) and exploit this bug at any time.

The problem itself was known but slipped. PR #1471 attempted to fix it by upgrading to the recommended version, 0.11.0, but while testing it we found an OOM that lead to DoS. The fix was accepted upstream but hasn't yet been released. We closed the PR expecting a release soon after, but that didn't happen.

This is a critical bug: it's allegedly easy to exploit and compromises soundness of the network.

Possible solutions:

  1. Disable (at least temporarily) the groth16 verifier;
  2. Use a replace directive to point to (at least) the fix commit;
  3. Push for a release upstream;
  4. Possibly restrict the number of commitments to 1 (at least temporarily) so the error can't be triggered.

The solutions aren't necessarily mutually exclusive.

@uri-99
Copy link
Contributor

uri-99 commented Jan 29, 2025

Closing, Gnark released a new version, as mentioned in related PR #1756

@uri-99 uri-99 closed this as completed Jan 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
audit cantina Audit report from Cantina operator
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants