Mystery Box

First Flight #25
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: high
Valid

Unrestricted Ownership Transfer

Summary

The changeOwner function allows anyone to change the contract's ownership without restrictions or authorization checks.

Vulnerability Details

MysteryBox.sol/Line

Impact

Anyone can call this function and take control of the contract, leading to loss of control for the original owner, and potentially leading to malicious actions like withdrawing all funds.

Tools Used

Foundry

Recommendations

Add an ownership check to ensure only the current owner can change ownership :

require(msg.sender == owner, "Only owner can change ownership");
Updates

Lead Judging Commences

inallhonesty Lead Judge
about 1 year ago

Appeal created

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

Anyone can change owner

Support

FAQs

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

Give us feedback!