Refund to players in function refund causes Reentrancy Attack.
In function refund, sendValue send the funds to msg.sender but msg.sender can call in the same function in the same transaction, which results in executing the whole refund function again. Thus, getting the entranceFee again. This process can be repeated continuously until all the funds are drained from the contract.
Attacker can drain all the funds by calling the refund function continuously as the state reset as shown above is after the sendValue function.
Manual Review
Transfers should always be at the bottom of the function to defend again Reentrancy Attacks.
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.