RustFund

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

No goal or deadline check in withdrawal of the fund

Summary

Funds withdrawable before goal or deadline

Vulnerability Details

The creator can withdraw funds at any time, even before the deadline or goal is met, which might not match crowdfunding intent or what the contributors wanted.
Contributor sends SOL,
Creator withdraws before deadline or goal

Impact

Contributors lose funds without fund completion

Tools Used

Manual review

Recommendations

Add conditions (e.g., goal met or deadline passed).

let clock = Clock::get()?;
require!(fund.amount_raised >= fund.goal ||
(fund.deadline != 0 && fund.deadline <= clock.unix_timestamp as u64),
ErrorCode::WithdrawalNotAllowed);
Updates

Appeal created

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

No deadline check in `withdraw` function

No goal achievement check in `withdraw` function

Support

FAQs

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