Skip to content
Access control Audit finding Beginner

Pending admin cannot accept ownership

The acceptAdminOwnership function in AlchemistCurator.sol is guarded by the onlyAdmin modifier, so the designated pending admin cannot call it to accept the transfer. Only the current admin can complete the handover, meaning the new admin's consent is never required.

ihtishamsudo Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

58469 sc low pending admin cannot accept ownership

Submitted on Nov 2nd 2025 at 14:30:25 UTC by @ihtishamsudo for Audit Comp | Alchemix V3

Description

Brief/Intro

The acceptAdminOwnership() function in AlchemistCurator.sol uses an incorrect access control modifier (onlyAdmin), preventing the intended new admin from accepting ownership transfer.

Vulnerability Details

The acceptAdminOwnership() function is protected by the onlyAdmin modifier, which restricts access to only the current admin:

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

Impact Details

The pendingAdmin cannot call acceptAdminOwnership() (reverts with "PD") Only the current admin can call this function

References

The pendingAdmin cannot call acceptAdminOwnership() (reverts with "PD") Only the current admin can call this function The current admin can complete the transfer unilaterally without the new admin's consent

Proof of Concept

Proof of Concept

Include this test in AlchemistCurator.t.sol and execute forge test --match-test "testAcceptAdminOwnershipBug" -vvv

Solidity
function testAcceptAdminOwnershipBug() public {
        // Setup: Admin transfers ownership to a new admin
        address newAdmin = address(0x5555555555555555555555555555555555555555);
        
        vm.prank(admin);
        mytCuratorProxy.transferAdminOwnerShip(newAdmin);
        
        // Bug: pendingAdmin cannot accept ownership because of onlyAdmin modifier
        vm.prank(newAdmin);
        vm.expectRevert(abi.encode("PD")); // Will revert with "PD" (Permission Denied)
        mytCuratorProxy.acceptAdminOwnership();
        
    }

- **Test log**

```bash
Ran 1 test for src/test/AlchemistCurator.t.sol:AlchemistCuratorTest
[PASS] testAcceptAdminOwnershipBug() (gas: 40937)
Suite result: ok. 1 passed; 0 failed; 0 skipped; finished in 7.95ms (2.48ms CPU time)

Ran 1 test suite in 26.62ms (7.95ms CPU time): 1 tests passed, 0 failed, 0 skipped (1 total tests)

The original report as published on Immunefi, by ihtishamsudo. 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 uses the onlyAdmin modifier instead of one that allows the pendingAdmin to call it.

Impact

The pending admin cannot accept ownership, so the current admin can complete the transfer unilaterally without the new admin's consent.

What the attacker needed

Admin role on the contract; ownership transfer already initiated

The fix

The acceptAdminOwnership function should be callable by the pendingAdmin rather than the current admin.

How it was found

  1. The current admin calls transferAdminOwnerShip to nominate a new admin.
  2. The nominated new admin calls acceptAdminOwnership.
  3. The call reverts with the permission-denied error because of the onlyAdmin modifier.

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 has an admin role that can be handed to someone else. The handover is meant to be two steps: the current admin nominates a new one, and the new one accepts. Here the accept step is locked to the current admin, so the nominated person can never accept, and the old admin can push the change through 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 ihtishamsudo

View all

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