Mystery Box

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

Lack of access control for function changeOwner

Summary

Anyone can become the owner and drain the whole pool

Vulnerability Details

In MysteryBox, there is one function called changeOwner. The function aims to change the owner of this contract.
The problem is that we lack of access control for this function. Anyone can become the owner via this function.

function changeOwner(address _newOwner) public {
owner = _newOwner;
}

Impact

Anyone can become the owner and drain the pool via withdrawFunds().

Tools Used

Manual

Recommendations

Add one onlyOwner modifier for function changeOwner.

Updates

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!