Christmas Dinner

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

M2 - Host can keep extending the deadline indefinitely.

Summary

The setDeadline function allows the host to repeatedly extend the event deadline. Although the deadlineSet variable is intended to restrict multiple extensions, it is not updated after the deadline is initially set, enabling the host to call the function multiple times and manipulate the event timeline.

Vulnerability Details

The setDeadline function lacks a mechanism to persistently lock the deadline once it has been set. As a result, the host can repeatedly invoke this function to extend the event deadline indefinitely, which could disrupt event scheduling and create trust issues among participants.

Affected Code:

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

Impact

  • The host can exploit this vulnerability to continuously delay the event.

  • Participants may lose trust in the event's credibility due to the uncertainty of the timeline.

  • Repeated deadline changes could disrupt planning for both participants and the event organizers.

Steps to Reproduce

  1. Deploy the smart contract containing the setDeadline function.

  2. As the host, call the setDeadline function with a valid _days parameter.

  3. Observe that the deadline is updated without any mechanism to restrict multiple updates.

Tools Used

  • Manual Review

  • Foundry Framework

Recommendations

Update the deadlineSet variable after the deadline is initially set to ensure that the function cannot be called more than once.

Updates

Lead Judging Commences

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

deadline is never set to true

0xtimefliez Lead Judge 8 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.