Open anarkrypto opened 1 week ago
here is the changes I used to exploit: https://github.com/proto-kit/private-airdrop-workshop/compare/develop...anarkrypto:exploit-private-airdrop-workshop:develop
according to maht0rz, development and sovereign envs still runs it out of the snark context "protokit isnt production ready, you’d need to wait for us to enable ‘proofs enabled’ to execute all your snarks in our paralelized proving backend"
Feel free to close this
A vulnerability exists in the current implementation of the claim process where an attacker can generate fake proofs and successfully claim multiple times without a wallet in the MerkleMap.
The Airdrop Runtime Module does not validates the message / signer of the nullifier. So while it's created on the client side, nothing ensures the nullifier is valid and unique per sender. https://github.com/proto-kit/private-airdrop-workshop/blob/8ee1fd6fdf98b2628ac678007416028e43288420/packages/chain/src/runtime/modules/airdrop.ts#L86-L92
The assertion of the commitment also does not guarantee the proof is valid, while the commitment is public, the attacker just needs query it from the module and send withing a fake proof class. https://github.com/proto-kit/private-airdrop-workshop/blob/8ee1fd6fdf98b2628ac678007416028e43288420/packages/chain/src/runtime/modules/airdrop.ts#L78-L84