Skip to content
Access control Audit finding Intermediate

Two step owner transfer is broken and can lead to unforseen damages

The two-step ownership transfer in AlchemistCurator is broken because acceptAdminOwnership can be called by the current admin when pendingAdmin is address(0), which sets admin to address(0) and loses admin rights. Also, the new admin cannot accept ownership because the function is restricted to the current admin.

Josh4324 Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

56418 sc low two step owner transfer is broken and can lead to unforseen damages

Submitted on Oct 15th 2025 at 19:24:07 UTC by @Josh4324 for Audit Comp | Alchemix V3

Description

Brief/Intro

The two-step ownership system is designed to protect against accidental ownership transfer or loss of ownership. However, with the way it is implemented in https://github.com/alchemix-finance/v3-poc/blob/immunefi\\_audit/src/AlchemistCurator.sol?utm\\_source=immunefi#L27-L35, ownership can easily be lost, renounced (transferred to address zero) or transferred to an inactive address (i.e being lost)

Vulnerability Details

The way traditional two-step ownership transfer works is that the admin transfers ownership to a new admin by calling transferAdminOwnerShip, and that new admin accepts the ownership by calling acceptAdminOwnership. This system prevents the accidental loss of admin privileges.

However, with the way the admin transfer system is designed, calling acceptAdminOwnership by the current admin when pendingAdmin is address(0) will lead to loss of admin rights.

See OpenZeppelin implementation here https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable2Step.sol

SOL
    function transferAdminOwnerShip(address _newAdmin) external onlyAdmin {
        pendingAdmin = _newAdmin;
    }

    function acceptAdminOwnership() external onlyAdmin {
        admin = pendingAdmin;
        pendingAdmin = address(0);
        emit AdminChanged(admin);//@audit not intended design
    }

Impact Details

  1. Accidental renouncing of admin rights: If acceptAdminOwnership is called when pendingAdmin is equal to address(0), admin rights will be lost. This can easily happen accidentally if the transaction is sent twice.
  2. Loss of admin rights to an invalid address: While not likely to occur, the original acceptAdminOwnership requires that the new owner is the "mes.sender"; this condition ensures that the new admin is an active wallet on that chain.
  3. Finally, it breaks the whole purpose or design of the two-step ownership transfer, because only one address is involved in the whole process.

References

https://github.com/alchemix-finance/v3-poc/blob/immunefi\\_audit/src/AlchemistCurator.sol?utm\\_source=immunefi#L27-L35

Recommendation

Use the original openzepplin implementation: https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable2Step.sol

Proof of Concept

Proof of Concept

I will be providing two POCs. Please add the following test to test/AlchemistCurator.t.sol

Accidental Renounce

SOL
    function testTransferAdminOwnerShipRenouce() public {
        vm.startPrank(admin);
        mytCuratorProxy.acceptAdminOwnership();
    }

Output

You can see that the admin has been accidentally renouced and set to address zero

Bash
[PASS] testTransferAdminOwnerShipRenouce() (gas: 17031)
Traces:
  [21831] AlchemistCuratorTest::testTransferAdminOwnerShipRenouce()
    ├─ [0] VM::startPrank(0x4444444444444444444444444444444444444444)
    │   └─ ← [Return]
    ├─ [10427] MockAlchemistCurator::acceptAdminOwnership()
    │   ├─ emit AdminChanged(admin: 0x0000000000000000000000000000000000000000)
    │   └─ ← [Return]
    └─ ← [Stop]

New Admin cannot accept ownership

SOL
    function testTransferAdminOwnerShipRevertsWhenNewAdminTriesToClaim() public {
        address newAdmin = address(0x5555555555555555555555555555555555555555);
        vm.startPrank(admin);
        mytCuratorProxy.transferAdminOwnerShip(address(0));
        vm.startPrank(newAdmin);
        mytCuratorProxy.acceptAdminOwnership();

    }

Output A new admin or a pending admin cannot accept ownership, thereby breaking the core design of the two-step ownership transfer.

Bash

  [20315] AlchemistCuratorTest::testTransferAdminOwnerShipRevertsWhenNewAdminTriesToClaim()
    ├─ [0] VM::startPrank(0x4444444444444444444444444444444444444444)
    │   └─ ← [Return]
    ├─ [5625] MockAlchemistCurator::transferAdminOwnerShip(0x0000000000000000000000000000000000000000)
    │   └─ ← [Return]
    ├─ [0] VM::startPrank(0x5555555555555555555555555555555555555555)
    │   └─ ← [Return]
    ├─ [782] MockAlchemistCurator::acceptAdminOwnership()
    │   └─ ← [Revert] revert: PD
    └─ ← [Revert] revert: PD

The original report as published on Immunefi, by Josh4324. 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 acceptAdminOwnership function lacks a check that pendingAdmin is not address(0) and is restricted to onlyAdmin instead of onlyPendingAdmin.

Impact

Admin rights can be accidentally lost or renounced, and the two-step transfer design is broken, potentially leading to protocol insolvency or ownership at risk.

What the attacker needed

Current admin calls acceptAdminOwnership; pendingAdmin is address(0)

The fix

Use the original OpenZeppelin Ownable2Step implementation, which checks that the caller is the pending owner and prevents setting the owner to address(0).

How it was found

  1. Current admin calls acceptAdminOwnership when pendingAdmin is address(0), which sets admin to address(0).
  2. Current admin calls transferAdminOwnerShip with a new admin address.
  3. New admin calls acceptAdminOwnership, but the transaction reverts because the function is restricted to the current admin.

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.

In smart contracts, an owner or admin has special permissions. A two-step transfer is meant to prevent mistakes: the current admin nominates a new admin, and that new admin must accept. Here, the accept function can be called by the current admin even when no new admin was nominated, which sets the admin to the zero address (nobody). Also, the nominated new admin cannot accept because the function only allows the current admin.

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 Josh4324

View all

10 more disclosed reports, best first.

More from Alchemix V3

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.