The claimFaucetTokens function lets a user claim faucet tokens and, if they are a first-time claimer, also receive 0.005 Sepolia ETH. The function updates claim tracking variables and then transfers tokens and ETH to the claimer.
The function uses a low-level call to send ETH before all state changes are finalized, creating a reentrancy window. A malicious contract can re-enter claimFaucetTokens() through its fallback function and repeatedly drain faucet tokens and ETH.
Likelihood:
A malicious contract can always trigger this by calling claimFaucetTokens() directly.
The faucet’s ETH balance can be drained in a single transaction since call() forwards all remaining gas.
Impact:
Multiple reentrant claims per transaction, leading to complete depletion of faucet tokens and ETH.
Contract unusable for legitimate users after exploitation.
Running this contract once will continuously re-enter until the faucet’s ETH or tokens are exhausted.
To mitigate this:
Apply OpenZeppelin’s ReentrancyGuard and mark claimFaucetTokens as nonReentrant.
Follow the Checks-Effects-Interactions pattern:
Perform all validation (require/revert).
Update state (e.g., isFirstTimeClaimer, dailyClaimCount).
Perform external transfers at the end.
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.