Any registered charity can be verified without requiring admin verification due to an incorrect use of the isVerified function, bypassing the intended verification logic.
In CharityRegistry, the isVerified function checks registeredCharities instead of verifiedCharities:
The verifyCharity function exists but is effectively useless because isVerified checks the wrong mapping.
The incorrect verification check creates an issue that bypasses the Admin verification logic. Since any registered charity is automatically considered verified, newly registered charities can bypass the intended admin verification process and immediately start receiving donations. This defeats the entire purpose of having a verification system.
The following Foundry code demonstrates that newly registered charities can bypass the verification logic and start receiving donations:
Run with forge test --match-test testAutoVerification -vv
Manual Review
Remix IDE
Foundry
Correct the isVerified function to check the proper mapping:
This ensures that only charities that have gone through the proper admin verification process can receive donations.
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.