RustFund

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

Title: Deadline Can Be Set Multiple Times

Summary

The set_deadline function is missing an essential update: it does not set dealine_set = true, which allows the deadline to be modified multiple times.

Vulnerability Details

  • The function checks if dealine_set is true before proceeding, but it never updates dealine_set = true after setting the deadline.

  • This means the check is ineffective, and the deadline can be modified indefinitely.

Impact

A campaign owner can continuously change the deadline, misleading contributors and preventing them from withdrawing refunds.

Tools Used

Manual code review.

Recommendations

Ensure dealine_set = true after setting the deadline

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;
fund.dealine_set = true; // ✅ Fix: Mark deadline as set
Ok(())

Updates

Appeal created

bube Lead Judge 5 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.