Trick or Treat

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

Lack of Proper Access Control on changeOwner

Summary

The SpookySwap::changeOwner function provides a way for the owner to transfer ownership but without any validation or safeguards.

Impact

The owner might accidentally transfer ownership to an zero address making it impossible to call functions with onlyOwner modifier.

Tools Used

Manual review

Recommendations

Add validation to ensure that _newOwner is not the zero address before transferring ownership.

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

Appeal created

bube Lead Judge 8 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.