RustFund

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

Missing Fund Balance Verification

Summary

The function does not check if the fund has enough lamports before attempting a refund, potentially leading to transaction failures.

Vulnerability Details

  • The function directly subtracts the refund amount from the fund's balance without verifying its sufficiency.

  • If the fund lacks enough lamports, the operation will fail unexpectedly.

Impact

  • The function can cause denial of service (DoS) for refund requests if the fund balance is insufficient.

  • Contributors may not receive their refund even if they are eligible.

Tools Used

Recommendations

Before transferring lamports, check that the fund has enough balance:

if ctx.accounts.contributor.key() != ctx.accounts.contribution.contributor {
return Err(ErrorCode::UnauthorizedContributor.into());
}
Updates

Lead Judging Commences

bube Lead Judge
5 months ago

Appeal created

bube Lead Judge 5 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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