Christmas Dinner

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

Deadline can still be updated even after it has been set

Summary

The setDeadline() function can still be called even after deadline has been set due to an incorrect logic error, and going against the function's intended design

Vulnerability Details

The function is not updating the deadlineStatus
to true after it has been set, making room to extend or shorten deadlines.

Impact

Unpredictable behavior or malicious misuse by the host, such as extending the deadline indefinitely to allow or prevent additional participants.

Tools Used

Manual Review, Foundry

Recommendations

we update the deadlineStatus after the function is called

function setDeadline(uint256 _days) external onlyHost {
if(deadlineSet) {
revert DeadlineAlreadySet();
} else {
+ deadlineSet = true;
deadline = block.timestamp + _days * 1 days;
emit DeadlineSet(deadline);
}
}
Updates

Lead Judging Commences

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

deadline is never set to true

Support

FAQs

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