claimFaucetTokens() sends Sepolia ETH to first-time claimers via a low-level call before updating critical state (lastClaimTime, dailyClaimCount). A malicious contract can re-enter through receive()/fallback(), executing the function twice in the same transaction. This results in double faucet token transfer and double daily claim count increment, while ETH drips only once (as hasClaimedEth flips true).
External call occurs before effects (violates Checks-Effects-Interactions).
Missing of nonReentrant modifier
Cooldown and counters are updated after the external call.
Likelihood:
Any externally-owned attacker can deploy a simple contract to claim; contracts are not blocked (only zero/faucet/owner are). On their first claim, ETH is attempted, opening the reentrancy window.
Impact:
Token inflation / rate-limit bypass: Attacker receives 2× faucetDrip in a single tx; cooldown is only applied after both transfers.
dailyClaimCount increments twice
Attacker Contract:
Test function:
Paste this test function in your test file and run:
forge test test/RaiseBoxFaucet.t.sol --mt testReentrancy_DoubleToken -vvvv
Please follow the Checks-Effects-Interactions (CEI) pattern and add a nonReentrant modifier.
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.