RustFund

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

Missing goal amount check in refund

Summary

the refund function lacks a check to verify whether the campaign’s funding goal has been met, allowing contributors to withdraw funds even after a campaign succeeds

Vulnerability Details

The refund function is intended to allow contributors to reclaim their SOL contributions if a campaign fails to meet its funding goal by the deadline. However, the current implementation only checks the deadline and misses a critical validation: it does not verify whether the campaign’s amount_raised is less than the goal. As a result, contributors can request refunds even when the funding goal has been met, undermining the campaign’s success and the creator’s ability to withdraw fund

Impact

This vulnerability allows contributors to withdraw their SOL contributions after a campaign has successfully met its funding goal, which violates the intended behavior of the platform.

Tools Used

Manual Code Review

Recommendations

The refund function should be updated to include a check verifying that the campaign’s raised amount is less than its goal

require!(ctx.accounts.fund.amount_raised < ctx.accounts.fund.goal, ErrorCode::GoalReached);
Updates

Appeal created

bube Lead Judge 3 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.