Mystery Box

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

Missing `address(0)` checks

Summary

Missing validation for address(0) when assigning values to address state variables.

Vulnerability Details

In the changeOwner() function, there is no check to prevent setting the owner to addres(0). As a result, the owner can be updated to a zero address.

Impact

This could lead to a loss of contract ownership, as the user might unintentionally or maliciously transfer ownership to address(0), making the contract inaccessible.

Tools Used

Manual review, Slither

Recommendations

Consider adding address(0) checks for _newOwner:

function changeOwner(address _newOwner) public {
+ require(_newOwner != address(0));
owner = _newOwner;
}
Updates

Appeal created

inallhonesty Lead Judge 11 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.