The GivingThanks::updateRegistryfunction lacks proper access controls allowing any users to change the registry address to an arbitrary CharityRegistrycontract, even a malicious one.
An attacker can deploy a malicious CharityRegistry contract that falsely verifies any address as an charity. By updating the registry they can manipulate the verification process in GivingThanks::donatefunction.
The malicious registry can falsely report that a charity is verified
Donors may unknowingly send funds to fraudulent charities, believing they are verified
The integrity of the protocol is compromised, leading to loss of user trust
The core functionality of charity verification is broken
Manual code review
Ensure the contract inherits Oppenzeppelin's Ownablecontract to utilize the onlyOwnermodifier.
Remove owner = msg.sender;from constructor since the contract inherits Ownablecontract
Use the onlyOwnermodifier in updateRegistryso only the owner can call the function and check for zero address.
For additional measures the function could emit an event when registry is updated to enhance transparency.
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.