Christmas Dinner

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

Improper Implementation of Reentrancy Guard

Summary

The nonReentrant modifier is incorrectly implemented, missing the critical locked = true statement.

Vulnerability Details

modifier nonReentrant() {
require(!locked, "No re-entrancy");
//@audit should set locked to true `locked = true;`
_;
locked = false;
}

The modifier checks if the contract is locked but never sets it to locked state before executing the function.

Impact

High - This allows reentrancy attacks on protected functions like refund(), potentially draining the contract's funds.

Tools Used

Manual review

Recommendations

modifier nonReentrant() {
require(!locked, "No re-entrancy");
//@audit should set locked to true `locked = true;`
_;
locked = false;
}
Updates

Lead Judging Commences

0xtimefliez Lead Judge about 1 year 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.

Give us feedback!