The claimFaucetTokens function should allow users to claim tokens only once every 3 days with proper state updates occurring before any external calls to prevent reentrancy attacks.
The function violates the Checks-Effects-Interactions pattern by making an external ETH transfer call (line 198) before updating critical state variables like lastClaimTime (line 227), enabling malicious contracts to reenter and bypass cooldown restrictions.
Likelihood:
Any malicious contract can exploit this vulnerability by implementing a receive() function that calls claimFaucetTokens() during the ETH transfer, as the cooldown state is not updated until after the external call completes.
The attack requires no special conditions or timing, making it consistently executable whenever the faucet has sufficient ETH balance for the drip mechanism.
Impact:
Complete bypass of the 3-day cooldown mechanism, allowing attackers to drain multiple faucet token allocations (1000 tokens each) in a single transaction through recursive calls.
Violation of daily claim limits and ETH distribution caps, as the dailyClaimCount increment occurs after the vulnerable external call, enabling unlimited claims before the counter updates.
The attack exploits the reentrancy vulnerability by creating a malicious contract that calls claimFaucetTokens() from its receive() function. Since lastClaimTime is updated after the ETH transfer, each reentrant call bypasses the cooldown check and steals additional tokens.
Move all state updates before any external calls to follow the Checks-Effects-Interactions pattern and prevent reentrancy attacks. Additionally, consider adding a reentrancy guard for extra protection.
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.