GivingThanks

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

Lack of Access Control in GivingThanks::updateRegistry function

Summary

The absence of access control allows unauthorized users to change the registry, potentially redirecting funds to malicious addresses and undermining the entire donation process.

Vulnerability Details

The updateRegistry function can be called by anyone, not just the contract owner. This allows malicious actors to redirect the registry to an unverified or malicious contract.

Impact

Without access control, unauthorized users can compromise the integrity of the charity verification process.

Tools Used

Manual Review

Recommendations

This can be applied by adding Ownable library

import "@openzeppelin/contracts/access/Ownable.sol";


Then apply the modifier in the function

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

Lead Judging Commences

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