Skip to content
Access control Audit finding Beginner

RenounceOwnership() is still live on CfdEngine, MarginClearinghouse and CfdEngineAdmin while the other three owner contracts revert it

Three governance contracts (CfdEngine, MarginClearinghouse and CfdEngineAdmin) still expose OpenZeppelin's one-step renounceOwnership, unlike three sibling contracts that override it to revert. A single owner call would permanently zero the owner and disable owner-only recovery functions, including the engine's degraded-mode exit.

farismaulana Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

#98650 [SC-Low] renounceOwnership() is still live on CfdEngine, MarginClearinghouse and CfdEngineAdmin while the other three owner contracts revert it

Submitted on Nov 9th 2026 at 09:25:57 UTC by @farismaulana for Audit Competition | Plether

Description

Brief/Intro

the codebase already treats "permanently giving up ownership" as a hazard and blocks it: HousePool, OrderRouterAdmin and EmergencyPauseCoordinator override renounceOwnership() to revert, with comments stating governance must retain recovery authority. three other governance-bearing contracts (CfdEngine, MarginClearinghouse and CfdEngineAdmin) never received that override and still expose OpenZeppelin's one-step renunciation. a single owner call on any of them zeroes the owner forever and takes the owner-only recovery functions down with it, including the engine's degraded-mode exit.

Vulnerability Details

the intended behavior is documented in the fixed contracts:

Solidity
    /// @notice Ownership cannot be renounced because governance must retain emergency recovery authority.
@>  function renounceOwnership() public view override onlyOwner {
        revert OwnableInvalidOwner(address(0));
    }

(HousePool.sol:264-267; the same reverting override exists in OrderRouterAdmin.sol:123-127 and EmergencyPauseCoordinator.sol:100-104.)

the other three governance-bearing contracts inherit OpenZeppelin Ownable2Step without the override, so renounceOwnership() is the stock Ownable implementation: a single owner call transfers ownership to address(0):

Solidity
@>  abstract contract CfdTreasury is ICfdEngineTypes, Ownable2Step {

(CfdTreasury.sol:10, inherited by CfdEngine at CfdEngine.sol:46)

Solidity
@>  contract MarginClearinghouse is IMarginAccount, Ownable2Step, ReentrancyGuardTransient {

(MarginClearinghouse.sol:30)

Solidity
@>  contract CfdEngineAdmin is Ownable2Step {

(CfdEngineAdmin.sol:17)

Ownable2Step guards transferOwnership with an accept step, but leaves renunciation one-step and irreversible: there is no accept path that can ever restore an owner once renounced. on the engine this permanently disables clearDegradedMode (CfdEngine.sol:658), recapitalizePool (CfdEngine.sol:632), setDependencies (CfdEngine.sol:345) and setPool (CfdEngine.sol:384); on the clearinghouse, the engine binding setEngine (MarginClearinghouse.sol:306) and rescueToken (MarginClearinghouse.sol:324); on the admin module, all risk/fee/calendar governance.

the asymmetry matters because renunciation is the only ownership action with no undo: a mis-keyed two-step transferOwnership can be cancelled by re-proposing, while a renunciation on these three contracts cannot be undone by anyone.

Impact Details

one owner call on CfdEngine, MarginClearinghouse or CfdEngineAdmin irreversibly destroys that contract's governance and recovery surface. if the engine is renounced and degraded mode later latches (_enterDegradedModeIfInsolvent, CfdEngine.sol:1351), there is no exit: clearDegradedMode is onlyOwner with a zero owner, and the router keeps rejecting every new order with OrderRouter__DegradedMode (OrderLiquidationBatchLogic.sol:326-330). the renunciation fix's stated intent (governance must always retain emergency recovery authority) holds on half the owner contracts and not on the other half; applying the same three-line override to the remaining three completes the remediation.

References

https://github.com/immunefi-team/audit-comp-plether/blob/a82d4fefb02768e5b3bddcc97dee371eee24fea8/packages/perps/src/CfdTreasury.sol#L10

https://github.com/immunefi-team/audit-comp-plether/blob/a82d4fefb02768e5b3bddcc97dee371eee24fea8/packages/perps/src/CfdEngine.sol#L46

https://github.com/immunefi-team/audit-comp-plether/blob/a82d4fefb02768e5b3bddcc97dee371eee24fea8/packages/perps/src/MarginClearinghouse.sol#L30

https://github.com/immunefi-team/audit-comp-plether/blob/a82d4fefb02768e5b3bddcc97dee371eee24fea8/packages/perps/src/CfdEngineAdmin.sol#L17

https://github.com/immunefi-team/audit-comp-plether/blob/a82d4fefb02768e5b3bddcc97dee371eee24fea8/packages/perps/src/HousePool.sol#L264-L267

https://github.com/immunefi-team/audit-comp-plether/blob/a82d4fefb02768e5b3bddcc97dee371eee24fea8/packages/perps/src/OrderRouterAdmin.sol#L123-L127

https://github.com/immunefi-team/audit-comp-plether/blob/a82d4fefb02768e5b3bddcc97dee371eee24fea8/packages/perps/src/EmergencyPauseCoordinator.sol#L100-L104

https://github.com/immunefi-team/audit-comp-plether/blob/a82d4fefb02768e5b3bddcc97dee371eee24fea8/packages/perps/src/CfdEngine.sol#L658-L666

Proof of Concept

Proof of Concept

add this file as test/poc/RenounceOwnershipGap.t.sol (uses the repository's BasePerpTest fixture, which deploys the full stack owned by the test contract):

Solidity
// SPDX-License-Identifier: AGPL-3.0
pragma solidity 0.8.35;

import {BasePerpTest} from "../perps/BasePerpTest.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {console2} from "forge-std/console2.sol";

/// @notice The prior review's renunciation fix (reverting renounceOwnership overrides) was applied to
///         HousePool, OrderRouterAdmin and EmergencyPauseCoordinator, but CfdEngine (via CfdTreasury),
///         MarginClearinghouse and CfdEngineAdmin still inherit OpenZeppelin's one-step renounceOwnership.
///         One owner call on any of the three zeroes the owner and permanently kills its owner-only
///         recovery surface: for the engine that includes clearDegradedMode, recapitalizePool,
///         setDependencies and setPool.
contract RenounceOwnershipGapTest is BasePerpTest {

    function test_renounceOwnershipLiveOnEngineClearinghouseAdmin() public {
        // Control: the fixed HousePool reverts and keeps its owner.
        vm.expectRevert(abi.encodeWithSelector(Ownable.OwnableInvalidOwner.selector, address(0)));
        pool.renounceOwnership();
        assertEq(pool.owner(), address(this));

        // Engine: renunciation succeeds and zeroes the owner.
        engine.renounceOwnership();
        assertEq(engine.owner(), address(0));
        console2.log("engine owner after renounce:", engine.owner());

        // The degraded-mode exit is now unreachable for everyone, permanently.
        vm.expectRevert(
            abi.encodeWithSelector(Ownable.OwnableUnauthorizedAccount.selector, address(this))
        );
        engine.clearDegradedMode();

        // Clearinghouse: same gap, setEngine binding and rescueToken die with the owner.
        clearinghouse.renounceOwnership();
        assertEq(clearinghouse.owner(), address(0));

        // Engine admin module (risk/fee/calendar governance): same gap.
        engineAdmin.renounceOwnership();
        assertEq(engineAdmin.owner(), address(0));
    }
}

run from packages/perps:

Bash
forge test --match-path test/poc/RenounceOwnershipGap.t.sol -vv

output:

Bash
Ran 1 test for test/poc/RenounceOwnershipGap.t.sol:RenounceOwnershipGapTest
[PASS] test_renounceOwnershipLiveOnEngineClearinghouseAdmin() (gas: 58322)
Logs:
  engine owner after renounce: 0x0000000000000000000000000000000000000000

Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 23.71ms (3.60ms CPU time)

the control leg shows HousePool reverting renunciation and keeping its owner; the three attack legs show renunciation succeeding on the engine, clearinghouse and admin, the engine owner reading address(0) afterwards, and clearDegradedMode() reverting OwnableUnauthorizedAccount because the only exit from degraded mode is owner-only and the owner is gone.

The original report as published on Immunefi, by farismaulana. 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 three contracts inherit OpenZeppelin's Ownable2Step without the reverting renounceOwnership override that the other three owner contracts implement.

Impact

One owner call on any of the three contracts could irreversibly destroy its governance and recovery surface, and if the engine is renounced while degraded mode latches, there is no exit and new orders keep being rejected.

What the attacker needed

Owner privileges on the contract

The fix

The same reverting renounceOwnership override should be applied to the remaining three contracts.

How it was found

  1. Call renounceOwnership on the engine and observe the owner becomes the zero address
  2. Call clearDegradedMode and observe it reverts because the caller is no longer the owner
  3. Call renounceOwnership on the clearinghouse and observe the owner becomes the zero address
  4. Call renounceOwnership on the admin module and observe the owner becomes the zero address

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.

Many smart contracts have an 'owner' account that can perform special actions, such as switching off an emergency mode. Normally ownership can be handed over in two steps, so a mistake can be cancelled. Here, three contracts also allow the owner to give up ownership in one irreversible step, which would leave nobody able to run those special actions ever again.

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 farismaulana

View all

28 more disclosed reports, best first.

More from Plether

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.