set_deadline() lets the creator set the fund's deadline once. It should only accept a future timestamp, since the deadline governs whether contributions are accepted and whether refunds are allowed. The problem is that set_deadline() validates only that the deadline has not been set before (dealine_set), but not that the provided value is in the future. The creator can set a deadline already in the past, which immediately closes contributions and/or opens the refund window in a single step.
Likelihood:
Occurs whenever the creator sets a deadline value less than or equal to the current timestamp.
Impact:
A past deadline immediately blocks new contributions (contribute checks deadline < now) and opens the refund window prematurely, letting the creator manipulate the fund lifecycle out of the intended order.
Creator creates a fund (deadline defaults to 0, dealine_set defaults to false).
Creator calls set_deadline with a timestamp in the PAST (e.g., 1).
The call succeeds — no validation rejects the past value.
Now contribute() rejects new contributions (deadline < now) and refund()'s
deadline gate is already open, all triggered out of the intended order.
Bonus: because dealine_set is never set to true, set_deadline can be called
again to change the deadline arbitrarily.
Note: demonstrates both the missing "future timestamp" check and the fact that dealine_set is never updated (so the "already set" guard never triggers). Running requires the Anchor test setup; both flaws are evident from the source.
Require deadline > current timestamp. Also set dealine_set = true (currently the flag is never updated, so the "already set" check never triggers — a secondary bug worth noting).
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.