In claimFaucetTokens() the contract makes an external call to send ETH to the claimer:
This external call occurs before the function updates lastClaimTime
and dailyClaimCount
. Although hasClaimedEth
and dailyDrips
are updated before the call, the other critical state variables are not. Because the external call transfers control to an EOA/contract, a malicious recipient contract can reenter claimFaucetTokens()
and call it again before lastClaimTime
and dailyClaimCount
are changed. That allows bypassing cooldowns and daily limits and enables multiple token transfers from the faucet.
Likelihood: HIGH
Impact: HIGH
An attacker (contract) can perform reentrancy to drain faucet token balance (multiple token _transfer
operations) and circumvent daily claim limits and cooldowns. This can lead to severe token loss, abuse of faucet, and unintended token distribution.
Apply Check-Effects-Interactions: do all state updates that prevent reentry before the external call. Also make faucetClaimer
a local variable (not a contract-level storage var), and add a reentrancy guard.
Also add a reentrancy guard (OpenZeppelin ReentrancyGuard) to claimFaucetTokens:
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.
The contest is complete and the rewards are being distributed.