GivingThanks

First Flight #28
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: high
Valid

Unrestricted registry update

Summary

The updateRegistry function lacks access control, allowing anyone to change the charity registry address.

Vulnerability Details

In GivingThanks.sol::updateRegistry:

function updateRegistry(address _registry) public { //Anyone can update the registry
registry = CharityRegistry(_registry);
}

updateRegistry lack access control allowing anybody to update the registry.

Impact

The lack of access control allows Attackers to point to a malicious registry contract, leading to losing control over key functionalities like charity verification and Admin changing.

Proof Of Concept

The Attacker can simply update the Registry address with any address they own and gain complete ownership over the registry.

Tools Used

  • Manual review

  • Remix IDE

Recommendations

Add owner access control:

function updateRegistry(address _registry) public {
+ require(msg.sender == owner, "Only owner can update registry");
registry = CharityRegistry(_registry);
}
Updates

Lead Judging Commences

n0kto Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

finding-anyone-can-change-registry

Likelyhood: High, anyone can change it at anytime Impact: High, can bypass the verification process

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.