The Refund() function invokes sendValue(), which includes a callback to the msg.sender before updating the state of players[playerIndex]. This creates a vulnerability that allows an attacker to perform a reentrancy attack by repeatedly calling refund() until all funds within the protocol are drained.
For POC, use contract Drainer as below to add enterRaffle and call refund:
Test case details:
Attacker can steal all fund in protocol
Manual review and foundry
Update players[playerIndex] before invoke sendValue(),conforming with Checks Effects Interactions pattern.
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.