Description: MysteryBox::changeOwner function does not have any access control and anyone can call this function to change the owner. A malicious user can set themself the owner of the contract and drain all the funds easily.
Impact: Ownership of the contract can be taken over by a malicious actor and they will have full control of the contract.
Proof of Concept:
Malicous user calls MysteryBox::changeOwner function and set's themself as the owner.
They can follow up with another call to MysteryBox::withdrawFunds and steal all the money.
Proof of Code:
Place the folowing into TestMysteryBox.t.sol
Recommended Mitigation: Add access control to the MysteryBox::withdrawFunds.
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.