RustFund

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

Contribution amount not tracked in contribute function leads to incorrect contribution record

Summary

The contribute function fails to update contribution.amount with the contributed amount. It initializes to 0 for new contributions but never increments it, leaving the contribution record inaccurate.

Vulnerability Details

The contribute function fails to update contribution.amount with the contributed amount. It initializes to 0 for new contributions but never increments it, leaving the contribution record inaccurate.

Impact

Users cannot track their total contributions accurately, which may confuse them or break refund logic relying on this value. It doesn’t directly compromise funds but undermines program reliability

Tools Used

manual code review

Recommendations

Add a line to increment contribution.amount after the lamports transfer in the contribute function:

contribution.amount += amount;
Updates

Appeal created

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

Contribution amount is not updated

Support

FAQs

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