hotfix: workaround gnark 0.10.0 unsoundness bug #1756
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.
A lot of time passed since gnark v0.10.0 unsoundness bug0 was reported
and fixed. We posponed the upgrade because the fixed release, v0.11.0,
contains another vulnerability, an OOM1, for which a fix has been in
main since last November but no release appeared until now.
Our options here are limited, and none quite happy:
redirect
to a commit inmain
;use; or
unsoundness can only be triggered with multiple commitments per proof.
This implements the latter option, being the least invasive one.
Fixes #1749
Type of change
Checklist
testnet
, everything else tostaging
Testing
You'll need to compare the behavior of batcher and operators in both
testnet
andhotfix/gnark_workaround
branches.Download the attached file to your repo checkout and extract it with
tar xf fake_proof.tgz
. The contents are a witness, proof and verification key that should not be accepted by gnark but are, and they were generated with the following PoC. The PoC relies on a modified checkout of gnark, as explained in the document explaining the vulnerability.Then apply this patch:
Start a devnet and run:
On
testnet
you should see a successful batch verification, as it's vulnerable to the unsoundness bug. Onhotfix/gnark_workaround
you should see both the batcher and operators (I suggest trying them separately with the rest of the stack running fromtestnet
, to be able to test each of them) reject the proof, logging that it has too many commitments.fake_proof.tgz