The cancelRegistration
function in the ThePredicter contract is vulnerable to reentrancy attacks due to the improper ordering of operations. The function does not follow the Checks-Effects-Interactions (CEI) pattern, potentially allowing an attacker to drain the contract's funds.
The vulnerable function is:
The vulnerability arises because the function:
1 . Checks the player's status
2 . Sends Ether to the player
3 . Updates the player's status
This order of operations violates the CEI pattern, allowing for a potential reentrancy attack.
An attacker could exploit this vulnerability to drain the contract of more Ether than they are entitled to.
Manual code review
Implement the Checks-Effects-Interactions pattern:
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.