Skip to content
Access control Audit finding Beginner

Incorrect onlyadmin modifier in acceptadminownership

The acceptAdminOwnership function in the AlchemistCurator contract uses the onlyAdmin modifier, so only the current admin can call it, not the pending admin. This means the intended two-step ownership transfer is effectively a single-party action by the current admin, and the pending admin cannot accept ownership.

silverologist Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

58333 sc low incorrect onlyadmin modifier in acceptadminownership

Submitted on Nov 1st 2025 at 10:40:22 UTC by @silverologist for Audit Comp | Alchemix V3

Description

Brief/Intro

The admin ownership transfer logic in the AlchemistCurator contract is implemented incorrectly. Instead of using a proper two step handover process where the new admin confirms ownership, the contract requires two separate actions from the current admin, effectively making it a single party transfer.

Vulnerability Details

The intended admin transfer process should occur in two distinct steps:

Step 1: The current admin initiates the transfer by designating a new pending admin. This part is implemented correctly in transferAdminOwnerShip:

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

Step 2: The pending admin should then confirm and accept ownership. However, this step is incorrectly implemented in acceptAdminOwnership:

Solidity
    function acceptAdminOwnership() external onlyAdmin {
        admin = pendingAdmin;
        pendingAdmin = address(0);
        emit AdminChanged(admin);
    }

The issue lies in the use of the onlyAdmin modifier, which restricts this function to the current admin instead of allowing the pending admin to call it.

Expected flow:

  • The current admin initiates the transfer to a new pending admin.
  • The pending admin accepts and becomes the new admin.

Actual flow:

  • The current admin initiates the transfer to a new pending admin.
  • The current admin must also execute the acceptance step to finalize the transfer.

Proof of Concept

Proof of Concept

Add the following test to ./src/test/AlchemistCurator.t.sol:

Solidity
    function testAdminOwnershipPoC() public {
        address newAdmin = address(0x1234567890123456789012345678901234567890);

        // the current admin requests a new admin
        vm.prank(admin);
        mytCuratorProxy.transferAdminOwnerShip(newAdmin);

        // the new admin should be able to accept admin ownership, but currently this reverts
        vm.prank(newAdmin);
        vm.expectRevert(abi.encode("PD"));
        mytCuratorProxy.acceptAdminOwnership();

        // instead, the current admin is able to accept the ownership of the new admin
        vm.prank(admin);
        mytCuratorProxy.acceptAdminOwnership();
    }

The original report as published on Immunefi, by silverologist. 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

The acceptAdminOwnership function is guarded by the onlyAdmin modifier instead of allowing the pending admin to call it.

Impact

The two-step ownership transfer is broken: the pending admin cannot accept, and the current admin can finalise the transfer alone, removing the intended confirmation step.

What the attacker needed

Current admin initiates transfer; pending admin is set

The fix

The acceptAdminOwnership function should be callable by the pending admin, for example by checking that the caller is pendingAdmin instead of using onlyAdmin.

How it was found

  1. The current admin calls transferAdminOwnerShip with a new admin address.
  2. The new admin calls acceptAdminOwnership, but the call reverts.
  3. The current admin calls acceptAdminOwnership and the transfer completes.

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 admin is a special user with extra powers. A safe way to hand over admin rights is a two-step process: the current admin nominates someone, and that person must accept. Here, the accept function is locked to the current admin, so the nominated person can never accept, and the current admin can just finalise the transfer alone.

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 silverologist

View all

5 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.