Mystery Box

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

Lack of input validation in function `changeOwner`

Summary

Lack of input validation in function changeOwner allows the owner to set the contract ownership to the zero address (0x0).

Vulnerability Details

The changeOwner() function does not validate the new owner address. This allows the owner to set the contract ownership to the zero address (0x0).

Impact

This could make the contract effectively unusable or unmanageable since no one would have control over it anymore.

Tools Used

Manual review.

Recommendations

Add a validation to ensure that the new owner address is valid (i.e., not the zero address). For example:

function changeOwner(address _newOwner) public {
require(_newOwner != address(0), "Invalid new owner");
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!