GivingThanks

First Flight #28
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: high
Valid

Malicious user can receive donations

Summary

Malicious user can register to receive donations without verification of admin.

Vulnerability Details

https://github.com/Cyfrin/2024-11-giving-thanks/blob/9580c8e5cfa23a00572ef6b7dfc790ba76778e4a/src/GivingThanks.sol#L22

Follow the statement, verified charity is anyone who only registers. So anyone can receive donations without admin's verification.

Impact

Malicious user can be donor to receive donations.

Tools Used

manual review

Recommendations

Change the registeredCharities to verifiedCharities in isVerified() function.

function isVerified(address charity) public view returns (bool) {
- return registeredCharities[charity];
+ return verifiedCharities[charity];
}
Updates

Lead Judging Commences

n0kto Lead Judge 7 months ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-isVerified-return-registered-charities

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.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.