Mystery Box

First Flight #25
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: low
Invalid

The MysteryBox contract implements a single-step ownership transfer mechanism.

Summary

The MysteryBox contract implements a single-step ownership transfer mechanism.

Vulnerability Details

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.

Impact

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.

Tools Used

Manual review

Recommendations

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.

Updates

Appeal created

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!