GivingThanks

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

Access Control on updateRegistry()

Summary

function updateRegistry can be called by anybody, no restriction in place.

Vulnerability Details

Anybody can call the function and change registry address.

If an attacker calls the function, it can change the address to a malicious contract.

function updateRegistry(address _registry) public {
registry = CharityRegistry(_registry);
}

Impact

ETH won't be donated to registry address as intended.

Tools Used

Manual Review

Recommendations

Add restriction to the function, onlyOwner.

function updateRegistry(address _registry) public onlyOwner {
registry = CharityRegistry(_registry);
}
Updates

Lead Judging Commences

n0kto Lead Judge 7 months 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.