GivingThanks

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

Lack of Zero Address Validation in `changeAdmin::CharityRegistry` Function

Description:

The changeAdmin::CharityRegistry function allows the current admin to set a new admin address without checking if the new address is the zero address (0x0000000000000000000000000000000000000000). This oversight can lead to loss of administrative control.

Impact:

Setting the admin to the zero address locks out all administrative functions, making the contract unusable.

Recommended Mitigation:

Add Zero Address Check:

function changeAdmin(address newAdmin) public {
require(msg.sender == admin, "Only admin can change admin");
require(newAdmin != address(0), "New admin cannot be zero address");
admin = newAdmin;
}
Updates

Lead Judging Commences

n0kto Lead Judge 10 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.