RustFund

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

Missing Input Validation on Contribution Amount

Summary

There is no check to ensure amount > 0. A contributor can submit a contribution of 0 SOL, potentially resulting in erroneous data.

Impact

Unintended 0-value contributions may create unnecessary accounts, increase storage costs, and complicate refund logic.

Recommendations

if amount == 0 {
return Err(ProgramError::InvalidArgument.into()); // ✅ Prevent 0 SOL contribution
}
Updates

Appeal created

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

[Invalid] Lack of minimal `amount` in `contribute` function

If user contributes 0 SOL, the `contribution.amount` will be updated with 0 value. There is no impact on the protocol. Also, the new contributers should pay for account creation, therefore there is no incentive someone to create a very huge number of accounts to contribute zero amount.

Support

FAQs

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