A single-step ownership transfer can result in the loss of ownership or administrative rights if an incorrect address is passed when attempting to transfer ownership. This vulnerability occurs in MysteryBox.sol, where the ownership transfer happens in one step. The risk is particularly high in scenarios where the owner mistakenly inputs the wrong address, leading to a permanent loss of ownership. Since ownership is critical for controlling functions that require msg.sender to be the owner (e.g., withdrawFunds), losing control can disable core functionalities of the contract.
If ownership is accidentally transferred to an incorrect or non-existent address, the owner will lose the ability to call vital functions, including the withdrawFunds function, potentially locking funds or disrupting the protocol's operation.
Manual review
To improve security, it is recommended to adopt a two-step ownership transfer process. In this pattern, ownership is placed in a "pending" state, and the new owner must explicitly accept ownership. This ensures that ownership is not lost accidentally. Consider using OpenZeppelin's Ownable2Step contract to implement this more secure ownership transfer mechanism.
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.