GivingThanks

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

No access control in updateRegistry

Summary

updateRegistry is missing the access control which allows anyone to update the registry with malicious control.

Vulnerability Details

updateRegistry is missing the access control to prevent anyone from updating the registry to malicious control.

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

Impact

Malicious actors can update the registry to a malicious contract and misuse it to mint the NFT bypassing the isVerified check.

Tools Used

Manual review.

Recommendations

Add the access control check so only the owner of the contract can update the registry.

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

Lead Judging Commences

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