RustFund

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

Deadline flag not updated

Summary

Deadline status flag is not set after the deadline assignment in set_dealine, which will lead to wrong deadline managment mechanism.

Vulnerability Details

  • The code checks for dealine_set but never actually sets the flag

  • Initial deadline check becomes functionally meaningless

Impact

  • The intended access control mechanism will be meaningless

  • Allows repeated deadline modifications

Tools Used

  • Manual code review

  • Test: By writing a test, where the owner of the Fund executes the function 2 times.

Recommendations

Setting the deadline_set property in the fund to true.

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.deadline_set = true;
Ok(())
}
Updates

Appeal created

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