GivingThanks
contract contains a vulnerability in the donate
function, where it incorrectly verifies the charity address by calling registry.isVerified(charity)
. This function only checks if the charity is registered, but does not confirm whether the charity has been verified by the admin, as it does not reference the verifiedCharities
mapping in CharityRegistry
.In the donate
function, the line:
registry.isVerified
, which only returns whether a charity is registered:registeredCharities
, meaning any registered charity can receive donations, regardless of verification. This error bypasses the intended verification process, where only charities marked as verified by the admin should receive donations.The vulnerability allows unverified charities to receive donations, undermining the security and integrity of the contract. Without proper verification, unauthorized or potentially malicious charities can register, bypass verification, and collect funds. This could lead to:
Donations being sent to potentially untrustworthy entities: Users expect donations to go only to verified charities, but due to this vulnerability, unverified charities can bypass the intended verification.
Loss of trust in the platform: Donors may lose confidence in the system if they discover funds are directed to entities that haven’t undergone a proper vetting process.
Manual
Update the Verification Logic: Modify isVerified
in CharityRegistry
to confirm both registration and verification statuses. The revised function should check verifiedCharities
rather than registeredCharities
:
Input
Output:
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.