GivingThanks

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

Lack of an access control feature in updateRegistry()

Summary

Lack of an access control feature in updateRegistry() which could potentially mislead donors into sending their funds to the wrong addresses.

Vulnerability Details

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

Anybody could call this function and update the address where the CharityRegistry contract is stored and with a wrong address, say containing another smartcontract allowing that manipulates the donor to fund a fake charity instead of a legitimate one.

Impact

Unsuspecting donors would be robbed of funds.

Tools Used

Manual review of the code.

Recommendations

Adding an access control feature in the updateRegistry as follows:

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

modifier onlyOwner(){

require(msg.sender == owner, "Not authorised!");

_ ;

}

Updates

Lead Judging Commences

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