Fund
Struct Prevents Proper Deadline EnforcementSeverity: Medium
Category: State Management / Input Validation
The RustFund protocol's Fund
struct contains a typographical error, misspelling deadlineSet
as dealineSet
. This typo causes inconsistent referencing and updating of the state, making deadline validation ineffective and allowing multiple deadline changes.
Root cause:
A typographical error in the naming of the state-tracking boolean (dealineSet
instead of deadlineSet
) within the Fund
struct results in the improper handling of state checks in the setDeadline
function.
Vulnerable Component:
File: lib.rs
Struct: Fund
Field: dealineSet
(should be deadlineSet
)
Function: setDeadline
Impact:
Campaign deadlines become mutable indefinitely.
Contributors are unable to rely on stable timelines.
Violates core protocol assumptions around state immutability.
Create a new fund.
Set an initial deadline.
Verify that the incorrectly named dealineSet
flag remains false.
Successfully set another deadline, bypassing intended restrictions.
Manual code review
Anchor test framework
Step 1: Correct the typo in the struct definition:
Step 2: Update all references consistently, especially within setDeadline
:
Ensure the error message clearly reflects the fix:
This is strong informational finding, there is no impact for the protocol. The variable is the same on all places.
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.