The donate function does not have a check to ensure that msg.value (the Ether sent by the user) is greater than zero. This means that users can send a donation of 0 ETH and still receive an NFT, which can lead to abuse of the system, where users may mint NFTs without actually making any contribution.
In this code, there is no check on msg.value. Therefore, even if msg.value is zero, the _mint function will still be called, and the user will receive an NFT without actually donating any Ether.
The user will receive an NFT with zero value, and the charity does not receive any donation.
manual review
Add a require statement to ensure that msg.value is greater than zero. Here’s the modified code with the fix:
Likelyhood: Low, anyone can mint an NFT with 0 amount. No reason to do it. Impact: Informational/Very Low, NFT are minted to a false donator. An NFT with 0 in the amount section would be useless. Since that's a bad design and not expected, I'll consider it Low but in a real contest, it could be informational because there is no real impact.
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.