cancelRegistration()
functioncancelRegistration()
function in ThePredicter.sol
is vulnerable to reentrancy leading to loss of funds.
In cancelRegistration()
function, entrancefee is refunded before playerStatus
is set to Cancelled thus it is possible to call cancelRegistration()
again and get contract to refund entrancefee more than once as function state is still Pending.
Re-entrancy can lead to theft of all funds in contract.
Manual Review, Foundry
Execute the state change playersStatus[msg.sender] = Status.Canceled;
before call (bool success,) = msg.sender.call{value: entranceFee}("");
Use special modifiers like reentrancygaurd
. from openzepplin's ReentrancyGaurd.sol
Reentrancy of ThePredicter::cancelRegistration allows a maliciour user to drain all funds.
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.