The refund
function is vulnerable to reentrancy, which gives the attacker the possibility to drain the funds from the contract.
The refund
function implements the nonReentrant
modifier which is supposed to guard against reentrancy:
However, the contract is never locked and the first line of code in the modifier always returns true. This vulnerability allows the attacker to repeatedly call the refund
function until there are no funds left in the contract (provided they'd sent some funds to the contract beforehand).
This vulnerability allows the attacker to drain the funds from the contract, which completely breaks the code logic.
Manual inspection.
The nonReentrant
modifier should be modified to lock the contract before entering a 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.