Can't claim last part of airdrop #130
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
resolved
Finding has been patched by sponsor (sponsor pls link to PR containing fix)
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Handle
gpersoon
Vulnerability details
Impact
Suppose you are eligible for the last part of your airdrop (or your entire airdrop if you haven't claimed anything yet).
Then you call the function claim() of AirdropDistribution.sol, which has the following statement:
"assert(airdrop[msg.sender].amount - claimable != 0);"
This statement will prevent you from claiming your airdrop because it will stop execution.
Note: with the function claimExact() it is possible to claim the last part.
Proof of Concept
// https://github.com/code-423n4/2021-11-bootfinance/blob/7c457b2b5ba6b2c887dafdf7428fd577e405d652/vesting/contracts/AirdropDistribution.sol#L522-L536
function claim() external nonReentrant {
..
assert(airdrop[msg.sender].amount - claimable != 0);
airdrop[msg.sender].amount -= claimable;
Tools Used
Recommended Mitigation Steps
Remove the assert statement.
Also add the following to validate() , to prevent claiming the airdrop again:
require(validated[msg.sender]== 0, "Already validated.");
The text was updated successfully, but these errors were encountered: