The setDeadline function fails to set the deadlineSet boolean to true after setting the deadline, allowing the host to repeatedly change the deadline despite the intended single-use design.
The function contains a check to prevent multiple deadline settings by verifying the deadlineSet boolean
However, after setting the deadline, the function fails to update deadlineSet to true. This oversight means that:
The check for deadlineSet will always return false
The host can call this function multiple times to change the deadline
The DeadlineAlreadySet() error will never be triggered
This vulnerability has medium severity because
It breaks a core contract invariant that the deadline should only be set once
It allows the host to manipulate the deadline multiple times, potentially disrupting participants' planning
It could be used maliciously to extend the deadline indefinitely or suddenly shorten it
However, it's mitigated by being restricted to the host only (onlyHost modifier)
Manual review
Add the missing state update to set deadlineSet = true after setting the deadline:
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.