The isVerified function is intended to return whether an address represents a verified charity. However, due to an error, it instead checks if the address is merely registered, failing to confirm actual verification.
In the CharityRegistry contract, the isVerified function currently returns the registeredCharities status of an address instead of the verifiedCharities status. This function should verify whether the charity has passed the verifyCharity step, but it mistakenly indicates that registration alone is sufficient.
By returning registeredCharities[charity] instead of verifiedCharities[charity], this implementation flaw causes the isVerified function to incorrectly confirm verification status for any registered address. Because there is no restriction on registration, any address can register as a charity and appear verified without going through the proper verification process.
This vulnerability enables unauthorized entities to bypass charity verification by simply registering. This could harm the protocol by allowing unverified charities to access benefits or functionality intended solely for verified entities. It undermines the security and integrity of the system, as any address can appear verified without actually meeting the verification requirements. This could lead to exploitation or loss of user trust in the charity verification system.
Manual Review
Modify the isVerified function to check the verifiedCharities mapping instead of registeredCharities, as shown below:
This change will ensure that only truly verified charities are marked as such in the contract.
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.