Mystery Box

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

lack of access controll in the changeOwner function

Summary

Vulnerability Details

https://github.com/Cyfrin/2024-09-mystery-box/blob/main/src/MysteryBox.sol#L111

the changeowner function is used to set a new owner

the changeOwner function lacks access control, that means it can be called by any one, and that is not intented by the protocol

Impact

since the is no access control in the changeOwner function a bad user can call this function and set the new owner of the contract to a malicious address which will disrupt the intended function of the contract

Tools Used

manual

Recommendations

an access controll should be added, making the function to be called by only owner

Updates

Appeal created

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