The locked variable is being handled incorrect within the modifier.
The value of locked is set to false after the function code _ is executed, this create an opportunity for a re-entrancy attack. After the function code is executed, the locked = false; is executed, which means the locked flag is reset after the function code completes.
An external contract can call back to the function locked because is set to false.
Scenario:
First Call: User calls a function.
The require(!locked) check passes, and the function starts executing (because locked is initially false).
Re-entry: If the function interact with another contract that calls back into the function, the check passes becasue the locked is updating at the end of the function execution.
Manual review
Set locked to true before executing the 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.