The function GivingThanks::updateRegistryas no access control and anyone can call it to update the registry address.
Even though a owner is specified in the constructor it is not used to restrict access for the GivingThanks::updateRegistry function. This means anyone could call GivingThanks::updateRegistryand update the registry address that points to a different contract instance which makes the registry vulnerable to manipulation.
Deploy GivingThanks contract with registry
User deploys their own registry contract
Malicious user calls GivingThanks::updateRegistry with manipulated registry address
Donor can donate to unverified charity
Code:
The following test demonstrates such a scenario:
The verification process is vulnerable to manipulation. Someone could easily deploy a custom registry contract that contains illegitimate charities without proper verification by the admin.
Foundry, manual review
Add check that allows only the owner to update the registry address (see diff below). In addtion, a function to change the owner (access controlled) is recommended. This code could also be written as a modifier. Or as an alternative, use modifier specified in Ownable.solby the OpenZeppelin library via import and inheritance.
Likelyhood: High, anyone can change it at anytime Impact: High, can bypass the verification process
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.