GivingThanks::updateRegistry lacks access control, allowing any user to call this function and modify the registry address. This exposes the contract to a security risk where malicious actors could redirect funds or change registry settings without authorization.
Without access control, anyone can alter the registry address, potentially pointing it to a malicious contract. This would allow attackers to intercept or misdirect funds intended for verified charities, leading to a significant loss of trust and potential financial damage.
Original updateRegistry function:
Potential Attack:
An attacker could call updateRegistry with an address they control.
This would enable the attacker to replace the legitimate registry with a malicious one, allowing unauthorized control over donation funds.
Restrict access to updateRegistry by using an access control mechanism, such as the onlyOwner modifier from OpenZeppelin's Ownable contract. This will limit the function to only be callable by the contract owner, ensuring authorized control over the registry.
Mitigated Code Example:
By using onlyOwner, only the contract owner has permission to update the registry, safeguarding the contract’s functionality.
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.