Severity: Medium
Category: Time-Based Logic / Economic Integrity
The RustFund protocol fails to enforce a strict cutoff for contributions at the campaign deadline. A contribution submitted at the exact timestamp of the deadline is still accepted, violating the expected campaign rules and compromising funding logic.
Root cause: Improper conditional check using >
instead of >=
when validating time in the contribute
function.
Affected Component:
Function: contribute
Struct: Fund
File: lib.rs
How it manifests:
The current logic checks if the deadline has passed (Clock::get()?.unix_timestamp > fund.deadline
)
This allows transactions submitted at the exact second of the deadline to go through
Protocol state becomes inconsistent, allowing post-deadline behavior during race conditions
Contributions can be accepted during or after the expiration moment
Opens potential for race conditions and fund accounting anomalies
Contributes to protocol unpredictability under heavy network load
Manual Review
Anchor Framework
JavaScript automation with setTimeout
to simulate timing
Update time logic in contribute
to reject contributions at or after the deadline:
This ensures clean cutoffs and prevents unpredictable post-deadline activity.
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.