RustFund

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

Missing Deadline Check in withdraw

Summary

The withdraw function allows the creator to withdraw funds at any time without checking the deadline.

Vulnerability Details

There’s no validation in withdraw to ensure the deadline has passed or been unset (deadline == 0) before allowing funds to be withdrawn, which might not align with crowdfunding expectations.

Impact

Creators can withdraw funds prematurely, potentially undermining trust in the fundraising system.

Tools Used

Manual Code Review

Recommendations

Add a deadline check:

if fund.deadline != 0 && fund.deadline > Clock::get()?.unix_timestamp.try_into().unwrap() {
return Err(ErrorCode::DeadlineNotReached.into());
}
Updates

Appeal created

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

No deadline check in `withdraw` function

Support

FAQs

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