The MerkleAirdrop::claim
function allows 4 lucky addresses to claim 25 USDC
. But this functions doesn't check if a given address had already claimed. Therefore a malicious address can claim
multiple times 25 USDC
until the balance of the protocol is drained.
The MerkleAirdrop::claim
function lacks a mechanism to track whether a user has already claimed his/her USDC. This permits malicious user from the list with lucky addresses to repeatedly invoke the claim
function with a valid proof and to withdraw more tokens than entitled.
Moreover if the other lucky addresses from the list have not claimed yet, the malicious user can claim the whole balance of the protocol and the other addresses will not be able to receive their USDC due to unsufficient balance of the protocol.
Let's consider the following test scenario. The collectorOne
calls 4 times the claim
function. The collectorOne
pays 4 times the fee
and receives 4 times from the claim
function the amountToCollect
(25 USDC). The balance of the protocol is 4 * 25 USDC
. Therefore, after the fourth call of the claim
function, there will be no more USDC in the protocol.
The testUsersCanClaimMoreThanOnce
function shows the described test scenario. You can execute this test through the foundry command: `foundry test --match-test "testUsersCanClaimMoreThanOnce" -vvvvv".
Manual Review, Foundry
Add a mapping that tracks if the user is already claimed:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.