Description: The 'ThePredicter::cancelRegistration' function isn't following CEI(Check Effect Interaction) and also don't have reentrancy preventing modifier. So can easily be exploited by reentrancy attack. Which can empty out the balance in contract. Also slither found it too.
Impact: All the money will be stolen.
Proof of Concept:
Classic reentrancy attack
The reentrancy attacker contract code is below.
and test function is below
Recommended Mitigation: Following CEI principle as much as possible, and using modifiers that prevents reentrancy attack is must if CEI was not followed.
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.