Christmas Dinner

First Flight #31
Beginner FriendlyFoundrySolidity
100 EXP
View results
Submission Details
Severity: high
Valid

Reentrancy Vulnerability in nonReentrant Modifier

Summary

The nonReentrant modifier incorrectly resets the locked variable to false before the function exits, potentially enabling reentrancy attacks.

Vulnerability Details

The nonReentrant modifier sets locked to false after the function execution (_). This is incorrect and may allow reentrancy attacks because the locked variable is reset before exiting the function.

Impact

loss of funds due to reentrancy attack.

Tools Used

mannual checks

Recommendations

Set locked to true before executing the function body and reset it to false after the execution

modifier nonReentrant() {
require(!locked, "No re-entrancy");
+ locked = true;
_;
locked = false;
}
Updates

Lead Judging Commences

0xtimefliez Lead Judge 11 months ago
Submission Judgement Published
Validated
Assigned finding tags:

mutex lock incomplete

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.