RustFund

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

No Check for Fund Completion in withdraw Function

Summary

The withdraw function does not check whether the fund has reached its goal before allowing the creator to withdraw funds. This could allow the creator to withdraw funds prematurely.

Vulnerability Details

The withdraw function does not validate if the amount_raised meets the goal:

Impact

The creator could withdraw funds even if the goal has not been met, which might not align with the intended behavior of the crowdfunding platform.

Tools Used

manual review

Recommendations

Add a check to ensure the fund has reached its goal before allowing withdrawal

if fund.amount_raised < fund.goal {
return Err(ErrorCode::GoalNotReached.into());
}
Updates

Appeal created

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

No goal achievement check in `withdraw` function

Support

FAQs

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