Skip to content
Access control Audit finding Beginner

Incorrect Inheritance of Ownership in Manager Contract Leading to Inconsistent Use of Ownable2Step

The Manager contract inherits from Ownable instead of Ownable2Step, so ownership transfers happen in one step rather than requiring the new owner to accept. This could allow an accidental or unauthorised ownership transfer to take effect immediately.

chista0x Follow

Originally disclosed on Immunefi

Informational View original
  • Disclosed after under an hour

#41145 [SC-Insight] Incorrect Inheritance of Ownership in `Manager` Contract Leading to Inconsistent Use of `Ownable2Step`

Submitted on Mar 11th 2025 at 17:05:53 UTC by @chista0x for Audit Comp | Yeet

Description

Brief/Intro

The StakeV2 contract, which inherits from Manager, is expected to leverage the safer ownership transfer mechanism provided by OpenZeppelin's Ownable2Step. However, the Manager contract mistakenly inherits from Ownable rather than Ownable2Step, which most contracts in the project use. This inconsistency could lead to unexpected behavior during ownership transfers.

Vulnerability Details

In the StakeV2.sol file, the project imports the Ownable2Step contract from OpenZeppelin. Despite this, the Manager contract is defined as follows:

Solidity
import "@openzeppelin/contracts/access/Ownable2Step.sol";

contract Manager is IManager, Ownable // @audit used Ownable instead of Ownable2Step
{
    // Manager implementation
}

contract StakeV2 is Manager, ReentrancyGuard {
    // StakeV2 implementation
}

Here, Manager inherits from Ownable, which does not include the two-step ownership transfer mechanism provided by Ownable2Step. Since the project standard is to use Ownable2Step for enhanced security during ownership transfers, this error creates a discrepancy that may compromise the intended safety features.

Impact Details

  • Security Risks: Without the two-step ownership transfer process, there is a higher risk of accidental or unauthorized ownership transfers. The safer Ownable2Step mechanism helps mitigate such risks by requiring explicit acceptance of the new ownership.
  • Consistency Issues: The deviation from the project’s standard inheritance pattern could lead to confusion among developers and auditors, and may result in inconsistent behavior across contracts.

Recommendation

To resolve this issue and ensure consistency with the rest of the project, update the Manager contract to inherit from Ownable2Step instead of Ownable. This change will align the ownership transfer process with the project's security standards and reduce potential risks.

Refrences:

StakeV2.sol

Proof of Concept

Proof of Concept (POC)

The issue is clearly visible in the contract inheritance structure.

Recommendation

To resolve this issue and ensure consistency with the rest of the project, update the Manager contract to inherit from Ownable2Step instead of Ownable. This change will align the ownership transfer process with the project's security standards and reduce potential risks.

Proposed Code Change:

Solidity
import "@openzeppelin/contracts/access/Ownable2Step.sol";

contract Manager is IManager, Ownable2Step {
    // Manager implementation
}

contract StakeV2 is Manager, ReentrancyGuard {
    // StakeV2 implementation
}

The original report as published on Immunefi, by chista0x. Images and videos are our own copies; raw HTML is shown as text. View it on Immunefi.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the Manager contract was declared to inherit from Ownable instead of Ownable2Step, contrary to the project's usual pattern.

Impact

Without the two-step transfer, there is a higher risk of accidental or unauthorised ownership transfers, though the report does not show a concrete exploit.

What the attacker needed

Ownership transfer is initiated

The fix

The Manager contract should inherit from Ownable2Step instead of Ownable.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A smart contract often has an owner who can change important settings. A safer pattern makes the new owner explicitly accept the role before it takes effect, which prevents mistakes like sending ownership to a wrong address. Here the contract used the simpler one-step version, so a transfer would happen straight away.

What is Access control?

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.

More by chista0x

View all

1 more disclosed report, best first.

More from Yeet

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.