The key functions, CharityRegistry::registerCharity(), CharityRegistry::verifyCharity(), CharityRegistry::isVerified() & CharityRegistry::changeAdmin() does not validate input addresses, making it possible for address(0) to be used as valid input.
CharityRegistry::registerCharity()
CharityRegistry::verifyCharity()
CharityRegistry::isVerified()
CharityRegistry::changeAdmin()
These functions do not validate if the charity address is address(0). Registering, verifying and changing admins with the address(0) does not make logical sense and may lead to unexpected behavior in subsequent checks or mappings. Changing the admin to address(0) for example will lock the contract permanently, all administrative functions and making the contract unmaintainable.
Allowing address(0) in these functions may lead to illogical or unexpected behavior, as address(0) should not be a valid charity or admin address.
Manual code review
Add address input validation for each function to check whether they are valid addresses and not address(0). This can be done with the require statement for example.
CharityRegistry::registerCharity()
CharityRegistry::verifyCharity()
CharityRegistry::isVerified()
CharityRegistry::changeAdmin()
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.