The BaseAdapter.sol contract inherits from OwnableUpgradeable, which allows for a single-step ownership transfer. This poses a risk of accidental ownership transfer to a mistyped or invalid address. It is recommended to use Ownable2StepUpgradeable instead, which implements a two-step ownership transfer process, requiring the new owner to explicitly accept the transfer.
The vulnerability lies in the use of OwnableUpgradeable (line 27 of BaseAdapter.sol). In Ownable, ownership is transferred immediately when the transferOwnership function is called. If the new owner address is mistyped or invalid, the contract ownership could be permanently lost. Ownable2StepUpgradeable mitigates this risk by requiring the new owner to explicitly accept the transfer, ensuring that ownership is only transferred to a valid address.
Affected Code:
Risk of Accidental Ownership Transfer: If the new owner address is mistyped, the contract ownership could be permanently lost.
Loss of Control: The contract owner could lose control over critical functionality or assets.
Severity: Low (no immediate threat, but a security improvement is recommended).
Manual code review
Replace OwnableUpgradeable with Ownable2StepUpgradeable to implement a safer ownership transfer mechanism. This ensures that ownership cannot be accidentally transferred to an invalid address.
Justification:
Safety: Ownable2Step requires the new owner to explicitly accept the ownership transfer, reducing the risk of human error.
Best Practice: OpenZeppelin recommends using Ownable2Step for contracts where ownership transfer is a critical operation.
Low Risk, High Reward: This change is low-risk but significantly improves the security of the contrac
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.