Refund allows for Reentrancy Attacks. All funds can be drained.
The function refund() breaks the Checks Effects Interactions pattern by first sending the refund and only afterwards setting the player at playerIndex to address(0). A malicious user can implement a smart contract with a fallback that immediately calls refund after receiving a refund from the raffle, thus draining all funds like the 2016 DAO hack.
High. All funds can be drained through a reentrancy loop.
n/a
Use OpenZeppelin's ReentrancyGuard modifier or swap lines 101 and 103, zeroing the participant address before paying him. This would follow the Checks Effects Interactions pattern and protect the funds.
reentrancy in refund() function
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.