The claimFaucetTokens function performs an external call to transfer tokens without implementing reentrancy protection. While the function has a cooldown mechanism, it violates the Checks-Effects-Interactions (CEI) pattern by updating state after the external call.
The specific issue is the absence of a ReentrancyGuard modifier combined with state updates occurring after the external token transfer, creating a potential attack vector.
Likelihood:
Requires malicious token contract or callback mechanism
Cooldown provides partial mitigation but not complete protection
Attack complexity is moderate
Violates security best practices
Impact:
Potential for reentrancy exploitation
State inconsistency during execution
Violation of established security patterns
Risk increases if token contract is upgradeable or malicious
This test demonstrates the CEI pattern violation and lack of reentrancy protection:
Setup: We deploy the faucet with a standard token
Observation: The function performs an external call before state updates
Risk: If the token has a callback, state can be manipulated
The vulnerability exists because:
No ReentrancyGuard modifier is present
External call happens before state updates
Cooldown check alone is insufficient protection
Violates Checks-Effects-Interactions pattern
Implement OpenZeppelin's ReentrancyGuard and follow the Checks-Effects-Interactions pattern by moving state updates before external calls. This prevents reentrancy attacks and follows security best practices.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
View preliminary resultsAppeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.