The setDeadline function contains a vulnerability that allows the host to overwrite the deadline multiple times, violating the intended one-time setup restriction. Additionally, there is no validation on the maximum value of _days, which can lead to unreasonably long deadlines.
Improper State Update:
The deadlineSet flag is not updated to true after successfully setting the deadline.
This allows the setDeadline function to be called repeatedly, overwriting the deadline.
Missing Input Validation:
There is no check to ensure that _days is within a reasonable range. This can lead to excessively long deadlines, potentially causing logical or operational issues.
The host can repeatedly call setDeadline to change the deadline, contrary to the intended design of a one-time deadline setup.
Setting an unreasonably long deadline could disrupt the system's usability and predictability.
Manual code review for validation and logical flow.
Ensure the deadlineSet flag is updated to true after setting the deadline.
Validate _days to ensure it is a positive number and does not exceed a sensible maximum.
Use a constant for the maximum deadline duration for better maintainability and clarity.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.