Mystery Box

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

Missing Access Control

Summary

There is no access control on changeOwner().

Vulnerability Details

The changeOwner function does not verfiy the caller before updating the owner address.

Impact

This will allow anyone to call this function and make themselves the owner of the contract. This will then allow them to immediately call withdraw() and drain the contract of its balance.

Tools Used

Manual Review

Recommendations

Update changeOwner() by adding the following:

require(msg.sender == owner);

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!