set_deadline (programs/rustfund/src/lib.rs) stores any u64 the creator passes, with no comparison against the current time and no rejection of 0:
Both contribute and refund treat deadline == 0 as "no deadline" and skip their time checks entirely:
Impact: Low — a deadline of 0 leaves the campaign with both gates open: contributions are accepted forever and refunds are available at any moment, so the campaign never reaches a defined end state. A timestamp in the past ends the campaign instantly: contribute is rejected and refund opens immediately, even seconds after creation. Combined with the missing goal check in refund, a zero deadline means contributors can pull funds at any time regardless of outcome; combined with the dead dealine_set guard, the creator can flip between these states at will.
Likelihood: Low — requires the creator to pass an invalid value, deliberately or by mistake (e.g. milliseconds instead of seconds, or an uninitialised variable yielding 0). No third party can trigger it.
Both calls are accepted by the program (same instruction builder as in tests/poc.ts):
Neither is rejected; there is no error code for an invalid deadline in the program.
Add InvalidDeadline to ErrorCode. Consider also requiring a deadline to be set before contribute accepts funds, so a campaign cannot exist in the "no deadline" state.
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.