set_deadline is intended to establish a fixed future date after which contributors can request refunds if the goal was not met.
The function performs no timestamp validation — any u64 value is accepted, including 1 (decades in the past). Setting deadline = 1 instantly makes the campaign appear expired: new contributions are blocked, refunds become immediately available, and any goal-based withdraw guard is satisfied. This enables a creator front-run attack — collect contributions while deadline is 0, then set deadline = 1 to freeze intake and immediately withdraw.
Likelihood:
A creator executing a rug-pull uses this to make all campaign state checks appear satisfied simultaneously — the deadline appears to have passed while the goal check (with a fixed withdraw) is also satisfied.
The window for exploitation spans from fund creation until set_deadline is first called, which can be the entire active campaign period.
Impact:
A creator freezes contribution intake at any time and immediately withdraws while blocking new contributors from participating.
Existing contributors cannot get refunds because the goal check (campaign "succeeded") is also satisfied by the manipulated deadline.
Place this test in tests/ and run anchor test. The test demonstrates that set_deadline() accepts a timestamp of 1 (decades in the past), instantly making the campaign appear expired and satisfying all deadline-dependent checks.
Add a require!(deadline > now, ErrorCode::DeadlineInPast) check inside set_deadline() so only future timestamps are accepted as valid deadlines.
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.