Mystery Box

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

H-3 Lack of access control on `MysteryBox::changeOwner` allows anyone to change the owner

Description
In MysteryBox::changeOwner function, there is no access control so anyone can change the owner.
Impact
Anyone can change the owner. Owner has ability to set the price of boxes, add new rewards, and withdraw funds. Anyone can be owner and withdraw funds.

Recommended mitigation

function changeOwner(address _newOwner) public {
+ require(msg.sender == owner, "Only owner can change the owner");
owner = _newOwner;
}
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!