RustFund

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

Withdraw funds without restrictions

Summary

The withdraw function allows the campaign creator to withdraw funds without enforcing restrictions on the fund status. This lack of conditionals opens the door to premature or unauthorized fund access.

Vulnerability Details

The code permits the withdrawal of all raised funds by the creator without verifying if the fundraising period has ended or if the funding goal has been met.

Impact

The creator might withdraw funds before the campaign concludes or reach the goal, which could lead to loss of trust among contributors.

Tools Used

Manual code review

Recommendations

Implement strict conditions that only allow withdrawals after the campaign’s deadline or once the funding goal is reached.

if current_time < fund.deadline && fund.amount_raised < fund.goal {
return Err(ErrorCode::CampaignNotEnded.into());
}
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.