The claim() function in the airdrop contract used an assert that fails when the remaining unclaimed amount equals the claimable amount, so a user could not claim the final portion of their airdrop through that function. An alternative function, claimExact(), still allowed the last part to be claimed, so funds were not lost but availability was affected.
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.
Remove the assert statement. Also add the following to validate() , to prevent claiming the airdrop again: require(validated\[msg.sender]== 0, "Already validated.");
Patched it with assert(airdrop[msg.sender].amount - claimable >= 0); the >=0 check is just to ensure the claimant does not end up claiming more than allocated due to any fringe case.
Downgrading to medium risk as an alternative path does exist for claiming the drop. Funds are not lost, but the availability of them is compromised. Per Docs:
2 — Med: Assets not at direct risk, but the function of the protocol or its availability could be impacted, or leak value with a hypothetical attack path with stated assumptions, but external requirements.
3 — High: Assets can be stolen/lost/compromised directly (or indirectly if there is a valid attack path that does not have hand-wavy hypotheticals).
The original report as published on Code4rena, by gpersoon. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Generating the AI write-up for this report.
This usually takes about 30 seconds. You can read the original meanwhile; this page updates itself.
Writing the technical write-up
Writing the version for beginners
Checking every passage against the original
How it worked
Root cause
Likely the assert condition was inverted or mis-specified: it required the remaining balance minus the claimable amount to be non-zero, which fails precisely when the user claims the exact remainder.
Impact
A user could not claim the last part of their airdrop through claim(), though claimExact() provided an alternative path, so funds were not lost but availability was compromised.
What the attacker needed
Eligibility for an airdrop; unclaimed airdrop balance
The fix
The assert was patched to check that the remaining amount minus the claimable amount is greater than or equal to zero, and the reporter also recommended adding a guard in validate() to stop repeat validation.
How it was found
Become eligible for an airdrop and leave the final portion unclaimed.
Call the claim() function of the airdrop contract.
The assert statement evaluates to zero and halts execution, so the claim fails.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Generating the AI write-up for this report.
This usually takes about 30 seconds. You can read the original meanwhile; this page updates itself.
Writing the technical write-up
Writing the version for beginners
Checking every passage against the original
An airdrop hands free tokens to eligible users, and a smart contract tracks how much each person can still collect. A check in the claim function was written so that it crashes exactly when someone tries to take their last remaining tokens, blocking that path. A different function still worked, so the tokens were not lost, just harder to get.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.