GivingThanks

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

[H-1] No accessControl in `GivingThanks::updateRegistry`

IMPACT: High
LikeliHood: Medium

Summary

The function updateRegistry updates the address of the targetContract of the registry, but it does not have any access control

Vulnerability Details

found in line 60 in GivingThanks.sol

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

Impact

anyone can change the address of the target registry, and thus severely interupting with the protocols functionality

Tools Used

Manual Review

Recommendations

add an extra check to make sure that whoever called this function is the admin.

function updateRegistry(address _registry) public {
+ require(msg.sender == admin, "only admin can update the registry");
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.