The MysteryBox::changeOwner() function lacks proper access control, allowing anyone to change the contract's owner without restrictions. This vulnerability could allow any user to gain control over the contract, enabling them to withdraw all funds and change important parameters.
An attacker can gain full ownership of the contract, enabling them to:
Withdraw all funds using MysteryBox::withdrawFunds().
Change the MysteryBox::boxPrice or manipulate rewards using the MysteryBox::setBoxPrice() and MysteryBox::addReward() functions.
Visual Studio Code
Solidity
Foundry
Restrict access to MysteryBox::changeOwner() to only the current owner.
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.