Even though Reentrancy attacks are less in Solana still it is possible to do. Since Solana allows Cross-Program Invocations (CPI), an attacker could create a malicious program that triggers refund multilpe times.
CEI pattern is not followed properly in this function lib.rs::refund()
The root cause lies in updating the amount variable after the SOL transfers.
Contributer can take over the entire SOL funds contributions of other contributors.
Manual Review
Update the below logic in lib.rs::refund() function
The reentrancy risk on Solana is highly eliminated. The `try_borrow_mut_lamports` ensures that only one reference to an account exists at a time. Also, once the fund’s lamports are borrowed mutably, no other transaction can modify them until the borrow is released. This means the function will reset the `amount` before the next call.
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.