The christmasDinner::nonReentrant modifier is not implemented correctly, leaving the contract vulnerable to reentrancy attacks.
The christmasDinner::nonReentrant modifier is not implemented correctly, leaving the contract vulnerable to reentrancy attacks. While the modifier intends to prevent reentrancy, the locked state variable is reset to false after executing the function logic (_). This implementation fails to adequately lock the function during its execution, as reentrancy protection should ensure the locked state remains true until the function execution is entirely complete.
Vulnerability to Reentrancy Exploits: Functions using this modifier are susceptible to reentrancy attacks, which can allow malicious actors to repeatedly call the function before the first invocation completes.
Manual Code Review
IDE
Update the nonReentrant modifier to set locked = true before the function execution and reset it to false after completion. A correct implementation would look like this:
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.