Describe the normal behavior in one or more sentences
Explain the specific issue or problem in one or more sentences
Likelihood:
Reason 1 // Describe WHEN this will occur (avoid using "if" statements)
Reason 2
Impact:
The set_deadline instruction lacks input validation, allowing a campaign creator to pass a historical timestamp. This instantly and permanently blocks all user contributions, bricking the fund lifecycle.
The set_deadline function at lib.rs:55-63 processes arbitrary u64 input parameters without checking the cluster runtime clock.
If a creator invokes this method with a past timestamp (e.g., 1), the logic loop inside the contribute instruction evaluates the current network time against this historical constraint. The transaction immediately fails the time window verification, rejecting all subsequent deposits and freezing the crowdfunding campaign state irreversibly.
Permanent Campaign Denial: Valid user contributions are blocked indefinitely.
Irreversible State Lock: Operational state data and base funding cannot be recovered or moved because the state criteria are broken.
The exploit path is completely deterministic. The set_deadline function accepts any u64 with zero validation against the current clock. The contribute function compares the stored deadline against Clock::get() using a strict less-than check. A past deadline makes this comparison permanently true. The fund is bricked with no recovery. The creator cannot fix it because dealine_set is never flipped to true (separate finding), enabling infinite deadline resets—but even setting a future deadline later is impossible if the flag were fixed, making the bricking irreversible.
The automated execution sequence initializes a standard crowdfunding target state, sets the deadline variable to the Unix epoch base value (1), and demonstrates that subsequent deposit instructions are rejected by the runtime:
Add a validation check in set_deadline that rejects any deadline earlier than the current blockchain timestamp. This prevents the creator from ever setting a past deadline and bricking the fund. This fix complements the dealine_set flag fix from the separate finding. Together, they ensure the deadline can be set exactly once to a meaningful future value, preventing both infinite resets and permanent bricking.
Modify the instruction handler and error configurations as shown below:
Add the corresponding error variant to the ErrorCode enum:
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.