Christmas Dinner

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

Missing Deadline Check in receive() Function

Summary

The receive() function allows ETH deposits without checking if the deadline has been set. This can lead to ETH deposits being accepted before the deadline is initialized.

Vulnerability Details

  • The beforeDeadline() modifier, which ensures that actions cannot occur after the deadline, is not applied to the receive() function.

  • As a result, ETH can be sent to the contract even before the deadline is set, which may not align with the intended contract logic.

Impact

  • ETH can be deposited into the contract before the deadline is set, potentially bypassing critical logic that depends on the deadline being established.

  • This could result in confusion or unintended behavior in the contract.

Tools Used

  • Manual review

Recommendations

Add the beforeDeadline() modifier to the receive() function to ensure that ETH deposits are rejected if the deadline has not been set:

receive() external payable beforeDeadline {
...
...
}
Updates

Lead Judging Commences

0xtimefliez Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

receive() function independant from deadline

Support

FAQs

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

Give us feedback!