RustFund

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

Refund allowed even if goal is already achieved.

Summary

The refund function allows contributors to withdraw funds even if the fundraising goal has already been reached.

Vulnerability Details

The function only checks if the deadline has passed but does not verify whether the goal was met. This can lead to situations where contributors withdraw funds from a successful campaign, potentially causing financial losses.

Impact

High. If the funding goal is reached, withdrawals could reduce the total raised, making the campaign ineffective.

Tools Used

Manual.

Recommendations

Add a check to prevent refunds if the funding goal has been met:

if ctx.accounts.fund.amount_raised >= ctx.accounts.fund.goal {
return Err(ErrorCode::FundingGoalReached.into());
}
Updates

Appeal created

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

There is no check for goal achievement in `refund` function

Support

FAQs

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