A high-severity vulnerability was discovered in the (MysteryBox) smart contract, where the (changeOwner) function is public and allows any user to modify the owner of the contract.
(changeOwner) does not has any access control and any user can call it.
Changing the owner of the contracts allows the attacker to extract all the funds stored in the contract with the (withdrawFunds) function, that need to be called by the owner of the contract.
Manual Analysis
Foundry: Smart contract testing and simulation framework
Add the following line to the very beginning of the changeOwner() function:
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.