Mystery Box

First Flight #25
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

Lack of zero address check in changeOwner function

Summary

The changeOwner function allows the owner to be set to the zero address (0x0000000000000000000000000000000000000000). If ownership is assigned to the zero address, it would effectively make the contract ownerless, preventing further control of the contract.

Vulnerability Details

The function allows ownership to be set to the zero address, which could render the contract ownerless and uncontrollable.

Tools Used

Manual

Recommendations

Add a require statement to ensure the new owner is not the zero address

function changeOwner(address _newOwner) public {
require(_newOwner != address(0), "New owner cannot be the zero address");
owner = _newOwner;
}
Updates

Appeal created

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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

Give us feedback!