The refund
function contains critical logic flaws that prevent proper refunds and could allow a malicious user to drain the entire fund balance.
There are multiple issues in the refund
function:
The function checks if the deadline hasn't been reached, but should actually check if either the deadline hasn't been reached OR if the fund goal has been met:
More critically, the function doesn't properly update the fund's amount_raised
value after a refund, which means multiple users could refund the same funds:
There's no check to ensure that the refund amount doesn't exceed the fund's current balance.
This vulnerability has severe consequences:
It allows any contributor to potentially drain the entire fund balance by repeatedly calling the refund function
It doesn't properly track refunds, which means the fund's accounting will be incorrect
Later contributors might not be able to get their refunds if earlier contributors have already drained the fund
The fund creator could lose access to legitimately raised funds
Manual code review
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.