RustFund

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

fund.dealine is never updated in the function set_deadline

Summary

The function set_deadline as a check to see if deadline as been set

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(())
}

but fund.dealine_set is never updated after to show deadline as been set.

Vulnerability Details

Without this update of set_dealine, the creator can increase or reduce the dead line time at will as they want, which go against the logic of the program.

Impact

Malicious creator might increase or decrease dead line for campaign at will.

Tools Used

Manual code review

Recommendations

Add the below to set_deadline function after fund.deadline = deadline

+ fund.dealine_set = true;
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.