Mystery Box

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

Missing access control in `changeOwner` function

Summary

Missing access control in changeOwner function

Vulnerability Details

Missing access control in changeOwner function.anyone can call the function and change the owner of the protocol and take advantage of the owner privellges.

Impact

  • Anyone can become the owner and do the following

    1. change price of the box

    2. add new rewards

    3. withdraw the funds

Tools Used

Manual review

Recommendations

  • use the following implmentaion in changeOwner function

function changeOwner(address _newOwner) public {
+ require(msg.sender==owner);
owner = _newOwner;
}
Updates

Appeal created

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