When users call the RaiseBoxFaucet::claimFaucetTokens function they claim RaiseBox tokens and first time users get some Sepolia ETH.
Because the function makes a low-level call to transfer Sepolia ETH to user an attacker can deploy a contract which reenters the function and double their RaiseBox tokens claim.
Likelihood:
Anyone can deploy a contract with a simple recieve function that calls claimFaucetTokensfunction so the likelyhood is very high.
Impact:
The invariant one claim per cooldown is bypassed. That's a business logic failure, not a inor edge case.
Flow
Attacker deploys a contract with a receivefunction that calls claimFaucetTokens.
Attacker calls claimFaucetTokenswith the deployed contract.
The RaiseBoxFaucetcontract sends Sepolia ETH to the attacker contract.
When attacker contract receives the Sepolia ETH it reenters the claimFaucetTokensfunction claiming RaiseBoxtokens two times.
Add this contract to test suite:
Add this code to the test contract
Add ReentrancyGuardto contract and add the nonReentrantmodifier to the claimFaucetTokensfunction.
Additionally all state changes and transfers should happen before the call, but adding the nonReentrantmodifier should be sufficiant.
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.