The refund
function fails to adjust the amount_raised
value in the Fund
account when a refund is processed. This leads to inaccurate tracking of raised funds, enabling potential double refunds and false reporting of campaign success.
While the refund transfers SOL back to the contributor, the amount_raised
value in the Fund
is not reduced.
This causes incorrect accounting, where amount_raised
still reflects refunded contributions.
Contributors could potentially request refunds multiple times, as the contract does not properly adjust the total.
Alice contributes 5 SOL to a campaign.
amount_raised = 5 SOL
.
Alice requests a refund and gets 5 SOL back.
However, amount_raised
remains at 5 SOL instead of decreasing to 0 SOL
.
The campaign falsely appears funded when it actually has fewer funds.
Potential exploit: Alice might call refund()
multiple times since her contribution record is reset without updating the fund balance.
Campaigns appear more funded than they actually are, breaking transparency.
Double-refund exploits could be possible, as funds are refunded without adjusting amount_raised
.
Creators might withdraw non-existent funds, thinking the campaign was fully funded.
Manual code review
To fix this issue, the amount_raised
value must be decreased when a refund is processed:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.