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.
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
- Report ID: #58469
- Report Type: Smart Contract
- Report severity: Low
- Target: https://github.com/alchemix-finance/v3-poc/blob/immunefi\\_audit/src/AlchemistCurator.sol
- Impacts:
- Contract fails to deliver promised returns, but doesn't lose value
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:
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
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)
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
- The current admin calls transferAdminOwnerShip to nominate a new admin.
- The nominated new admin calls acceptAdminOwnership.
- 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.