GivingThanks

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

Potential D.O.S in Donate function

Summary

A malicious user can change the registry to zero address thereby causing Donate function calls to always revert.

Vulnerability Details

Donate function makes an external call to the registry contract to verify if the target charity is verified before transfer of funds can proceed. However, this call will always revert if the address of registry contract is the zero address. A malicious party can call updateRegistry function as it lacks access control and set the registry to zero.

Impact

Charites will no longer receive donations.

Tools Used

Manual Review

Recommendations

Consider making the updateRegistry callable only by the owner:

function updateRegistry(address _registry) public {
+ require(msg.sender == owner, "Registry can only be updated by the owner!");
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.