The changeOwner() function has no access restriction, this leads to the fact that the owner variable can be reassigned by any user.
This problem leads to unlimited access to critical functions such as withdrawFunds() and setBoxPrice().
Vulnerable function:
Scenarios:
The user appoints himself as the owner and changes the boxPrice to 0 using the setBoxPrice() function. Now the user can buy boxes for free and receive a reward from them.
The user appoints himself as the ownerand with the help of the withdrawFunds function, he withdraws the funds of the contract.
In summary, the user can steal all the funds of the contract or take over the contract completely.
Manual code review
You can use one of these options:
1 | Add require before owner reassigning:
2 | Create an access modifier and assign it to functions that require access control:
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.