Christmas Dinner

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

nonReentrant() modifier does not work

Summary

Rentrant modifier is never set to true. Every require check will pass because locked will also be false. Thus, the modifier will never prevent re-entrancy. Affects refund() as well as internal functions _refundERC20() and _refundETH(). Contract does not import reentrancyGuard.sol from OZ.

Vulnerability Details

modifier nonReentrant() { //@audit - broken modifier. locked never = true.
require(!locked, "No re-entrancy");
_;
locked = false;
}

Impact

refund() function can be re-entered. Subsequent internal functions _refundERC20 and _refundETH are also affected.

Tools Used

Manual Review

Recommendations

Directly import and implement reentrancyGuard.sol from OZ.

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!