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

Vulnerability in Proof Validation Allows Claim Exploit #1

Open
anarkrypto opened this issue Sep 5, 2024 · 2 comments
Open

Vulnerability in Proof Validation Allows Claim Exploit #1

anarkrypto opened this issue Sep 5, 2024 · 2 comments

Comments

@anarkrypto
Copy link

anarkrypto commented Sep 5, 2024

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.

const isNullifierUsed = await this.nullifiers.get(
airdropProof.publicOutput.nullifier
);
assert(isNullifierUsed.value.not(), "Nullifier has already been used");
await this.nullifiers.set(airdropProof.publicOutput.nullifier, Bool(true));

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.

airdropProof.verify();
const commitment = await this.commitment.get();
assert(
airdropProof.publicOutput.root.equals(commitment.value),
"Airdrop proof does not contain the correct commitment"
);

@anarkrypto anarkrypto changed the title Vulnerability in Nullifier Validation Allows Double Claim Exploit Vulnerability in Proof Validation Allows Claim Exploit Sep 5, 2024
@anarkrypto
Copy link
Author

here is the changes I used to exploit: develop...anarkrypto:exploit-private-airdrop-workshop:develop

@anarkrypto
Copy link
Author

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

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

No branches or pull requests

1 participant