The isVerified function in the CharityRegistry contract incorrectly returns the registration status of charities rather than their verification status. Specifically, this function returns registeredCharities[charity] instead of verifiedCharities[charity], allowing donations to charities that are only registered, not verified. This misconfiguration can result in funds being sent to unverified charities. Updating the isVerified function to return verifiedCharities[charity] mitigates this vulnerability, ensuring only verified charities can receive donations as intended.
The isVerified function currently returns registeredCharities[charity], which only indicates whether a charity has been registered, not verified. This oversight allows donations to charities that are registered but lack the intended verification status.
Details:
Incorrect return statement: The isVerified function currently returns the value of registeredCharities[charity], checking for registration rather than verification.
Impact: This allows donations to unverified charities, bypassing intended verification checks and reducing the contract’s trustworthiness.
This issue is resolved by modifying the isVerified function to return verifiedCharities[charity], ensuring that only verified charities are eligible to receive donations.
Original isVerified Function in CharityRegistry:
Corrected isVerified Function::
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.