RustFund

First Flight #36
Beginner FriendlyRust
100 EXP
View results
Submission Details
Severity: high
Invalid

Typo in Fund Struct Field

Summary

The set_deadline function allows setting deadlines in the past.

Vulnerability Details

No validation ensures the deadline is in the future, allowing immediate expiration of the fund.

Impact

A creator could set an already-passed deadline, preventing contributions or enabling immediate withdrawals/refunds, potentially maliciously.

Tools Used

Manual Code Review

Recommendations

Add validation:

let current_time = Clock::get()?.unix_timestamp.try_into().unwrap();
if deadline <= current_time {
return Err(ErrorCode::DeadlineReached.into());
}
Updates

Appeal created

bube Lead Judge 3 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

[Invalid] Wrong naming of `deadline_set`

This is strong informational finding, there is no impact for the protocol. The variable is the same on all places.

Support

FAQs

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