Forging zkSNARK Proofs via Misconfigured Verification Keys: The V
The Groth16 verifier contract used by a private ETH pool was deployed with identical gamma and delta parameters, breaking the soundness of the pairing check. An attacker could therefore adapt a single valid proof to arbitrary public inputs, including fabricated nullifiers, and repeatedly withdraw funds without making deposits.
In this analysis, we will reconstruct the mechanics of the attack on the private pool Veil01ETH (denomination 0.1 ETH) in the Base network.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
The Groth16 verifier was deployed with gamma equal to delta, so the pairing equation no longer binds the proof to the public inputs and C can be set to minus the linear combination of input points.
Impact
The attacker withdrew 2.9 ETH from the pool without making any deposits, by calling withdraw 29 times with fabricated nullifiers.
What the attacker needed
Access to the on-chain verifier contract; a single valid proof for the circuit; ability to submit transactions to the pool
The fix
The verifier should be deployed with distinct, correctly generated gamma and delta values so that the pairing check binds the proof to the public inputs.
How it was found
- Observe the withdraw transaction and its repeated calls to the pool contract.
- Decode the calldata and note that only the nullifier hash and the C proof point change between calls.
- Check the verifier's constants and find that gamma and delta are identical.
- Compute the linear combination of input points from the chosen public inputs.
- Set C to the negation of that combination so the pairing check passes.
- Call withdraw repeatedly with different nullifier hashes to receive the denomination each time.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A zero-knowledge proof lets someone show they know a secret without revealing it, and a verifier contract checks that proof. Here the verifier was set up with two internal values that should have been different but were the same, which made the check meaningless. The attacker could then reuse one valid proof, tweak it for made-up withdrawal identifiers, and drain the pool.
What is Smart contracts?
Flaws in on-chain code that let an attacker drain funds, freeze them or break the protocol's accounting.