The donate
function transfers Ether to an external address and then performs other operations, making it susceptible to reentrancy attacks.
Without reentrancy protection, the function is vulnerable to reentrancy attacks, where a malicious contract could repeatedly call donate and drain funds.
https://github.com/Cyfrin/2024-11-giving-thanks/blob/main/src/GivingThanks.sol#L21-L33
If exploited, this vulnerability could lead to loss of user funds and undermine the contract’s financial security.
Manual Review
Use OpenZeppelin’s ReentrancyGuard and apply the nonReentrant modifier to the donate function:
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.