Severity: Medium
Category: State Management / Input Validation
The RustFund protocol includes a dealineSet flag intended to restrict deadline modifications to a single instance. However, this flag is never updated within the setDeadline function, rendering it ineffective. Consequently, fund creators can repeatedly change campaign deadlines.
Root cause:
The setDeadline function fails to set the dealineSet boolean flag after the initial deadline assignment. Although the flag is checked at the start of the function (if fund.dealineSet), the flag remains permanently set to false.
Vulnerable Component:
File: lib.rs
Function: setDeadline
Struct: Fund
Impact:
Fund creators can arbitrarily adjust deadlines multiple times, undermining the integrity of fixed campaign timelines.
Contributors lose certainty around campaign deadlines, negatively impacting decision-making and trust.
Protocol guarantees regarding deadline immutability are not enforced, violating core design principles.
Create a new fund.
Call setDeadline once to establish the initial deadline.
Inspect the dealineSet flag, verifying it remains false.
Successfully call setDeadline again to modify the deadline.
Manual code review
Anchor test framework
Update the setDeadline function to properly set the dealineSet flag upon the first deadline assignment:
Additionally, define the corresponding error code clearly:
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.