The claimAllRewards() and claimSingleReward() functions are vulnerable to reentrancy attacks due to the transfer of ETH before updating the internal state. Attackers can exploit this flaw to drain the contract's balance by repeatedly calling the claim functions before the state is updated.
The functions transfer ETH to the user before updating the state of rewards, allowing a malicious contract to reenter the function and claim additional rewards.
Location: claimAllRewards(), claimSingleReward()
Fund Drainage: An attacker can use a malicious contract to call the claim function in a loop, draining the contract's ETH balance before the internal state is updated.
Denial of Service: Reentrancy can lead to a complete depletion of contract funds, preventing legitimate users from claiming their rewards.
Manual Code Review
Remix IDE
Use the checks-effects-interactions pattern by updating the state of the contract before transferring funds. Alternatively, implement a reentrancy guard:
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.