CharityRegistry::isVerified view function returns registeredCharities, instead of verifiedCharities. An attacker can trick users to send donations to their unverified charity as anyone can register a charity, but only admin can verify them.
CharityRegistry::isVerified returns the wrong mapping:
While at first this seems like a trivial issue, if you look at GivingThanks::donate function and consider a specific scenario, it becomes quite serious.
GivingThanks::donate function checks if a charity is verified or not.
Consider the following scenario: Alice, a donator, trusts the platform's admin and verification status. She decides to make a donation to a charity.
Bob, a malicious actor, registers a bogus charity and somehow persuades Alice that it is a geniune charity. Mind that Alice, even if she does not trust Bob, trusts the protocol and sends donation to that bogus address. Since the require(registry.isVerified(charity), "Charity not verified"); line is present, she believes she's in the safe spot.
But since CharityRegistry::isVerified returns true in registered addresses, that can be registered by anyone and anytime, and NOT the verified, trusted addresses, Alice will be tricked into sending her money into a bogus charity address.
Users will get their money stolen, and the protocol's credibility will suffer immensely.
Manual review.
Fix the CharityRegistry::isVerified function as follows:
Likelyhood: High, the function returns registered charities instead of verified ones. Impact: High, Any charities can be registered by anyone and will be declared as verified by this function bypassing verification.
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.