The contract allows any user to change ownership of the MysteryBox
contract. This is due to missing access control on the changeOwner
function.
The changeOwner()
function is missing access control, allowing any user to gain ownership of the contract, which would then allow them to drain all user funds using the withdrawFunds()
function.
Owner change of contract, ability to drain contract of all user funds.
Manual review, OpenZeppelin.
Apply an onlyOwner
modifier to the function. This can be done either by creating the modifier, or preferrably, importing the OpenZeppelin Ownable contract which has the modifier available.
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.