RustFund

First Flight #36
Beginner FriendlyRust
100 EXP
View results
Submission Details
Severity: medium
Valid

`fund.deadline_set` not being set to true.

Summary

fund.deadline_set is not being set to true after defining a deadline, meaning the creator can reset it anytime.

Vulnerability Details

fund.deadline_set is not being set to true after setting a deadline, this means the creator can keep setting it to anytime he wants without restrictions.

https://github.com/CodeHawks-Contests/2025-03-rustfund/blob/main/programs/rustfund/src/lib.rs#L55-L63

pub fn set_deadline(ctx: Context<FundSetDeadline>, deadline: u64) -> Result<()> {
let fund = &mut ctx.accounts.fund;
if fund.dealine_set {
return Err(ErrorCode::DeadlineAlreadySet.into());
}
fund.deadline = deadline;
Ok(())
}

Impact

creator can reset it anytime, even after the current deadline it's over.

Tools Used

manual

Recommendations

assign fund.set_deadline = trueright after setting a deadline.

Updates

Appeal created

bube Lead Judge 2 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Deadline set flag is not updated in `set_deadline` function

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.