A reentrancy attack in `ThePredicter::CancelRegistration` allows an attacker to steal all of the funds because it doesn't follow the Check-effects-interactions pattern
In the provided function ThePredicter::cancelRegistration
is potentially vulnerable to reentrancy attacks. This is because it first sends Ether to msg.sender and then updates the state of the contract. An attacker can exploit this vulnerability by repeatedly calling the cancelRegistration function before the contract has a chance to update its state
The impact of this vulnerability is severe as it allows an attacker to drain all the funds from the `ThePredicter` contract. This can lead to significant financial loss for the users of the contract.
PoC
Manual code review and testing with the forge library.
To fix it the function ThePredicter::cancelRegistration
should follow CEI and send the money after we update the state
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.