Skip to content
Access control Audit finding Intermediate

Simplex ownership cannot be transferred

The SimplexDiamond contract's ownership transfer function is present, but the function to accept ownership is missing from the diamond's function selector list. As a result, the new owner cannot accept ownership, and the owner remains unchanged.

0L5S6W Follow with CasinoCompiler, TessKimy and 8 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-04-burve-judging/issues/130

Found by

0L5S6W, CasinoCompiler, TessKimy, Tigerfrake, aman, h2134, heeze, imageAfrika, klaus, kom, teoslaf1

Summary

acceptOwnership() is missed when adding facets to SimplexDiamond, leading to the ownership cannot be transferred.

Root Cause

When creates SimplexDiamond, BaseAdminFacet is added to the diamond.

SimplexDiamond::constructor():

Solidity
        {
            bytes4[] memory adminSelectors = new bytes4[](3);
@>          adminSelectors[0] = BaseAdminFacet.transferOwnership.selector;
@>          adminSelectors[1] = BaseAdminFacet.owner.selector;
@>          adminSelectors[2] = BaseAdminFacet.adminRights.selector;
            cuts[2] = FacetCut({
                facetAddress: address(new BaseAdminFacet()),
                action: FacetCutAction.Add,
                functionSelectors: adminSelectors
            });
        }

transferOwnership() in BaseAdminFacet does not transfer the ownership directly to the new owner, it requires the new pending owner to accept the ownership.

BaseAdminFacet::transferOwnership():

Solidity
    function transferOwnership(address _newOwner) external override {
        AdminLib.reassignOwner(_newOwner);
    }

BaseAdminFacet::acceptOwnership():

Solidity
    /// The pending owner can accept their ownership rights.
    function acceptOwnership() external {
        emit IERC173.OwnershipTransferred(AdminLib.getOwner(), msg.sender);
        AdminLib.acceptOwnership();
    }

The problem is that acceptOwnership() is not added to the cut, as a result, the ownership won't be accepted.

Internal Pre-conditions

Simplex owner transfers the ownership.

External Pre-conditions

None

Attack Path

None

Impact

The new pending owner won't be able to accept the ownership.

PoC

Please run forge test --mt testAudit_SimplexOwnershipCannotBeTransferred.

Solidity
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.27;

import "forge-std/Test.sol";
import "../src/multi/Diamond.sol";
import "../src/integrations/adjustor/MixedAdjustor.sol";

contract AuditTest is Test {

    address owner = makeAddr("OWNER");

    SimplexDiamond simplex;

    function setUp() public {

        BurveFacets memory facets;

        {
            address vauleFacet = address(new ValueFacet());
            address valueTokenFacet = address(new ValueTokenFacet());
            address simplexFacet = address(new SimplexFacet());
            address swapFacet = address(new SwapFacet());
            address vaultFacet = address(new VaultFacet());
            MixedAdjustor mixedAdjustor = new MixedAdjustor();
            address adjustor = address(mixedAdjustor);

            facets = BurveFacets({
                valueFacet: vauleFacet,
                valueTokenFacet: valueTokenFacet,
                simplexFacet: simplexFacet,
                swapFacet: swapFacet,
                vaultFacet: vaultFacet,
                adjustor: adjustor
            });
        }

        vm.prank(owner);
        simplex = new SimplexDiamond(facets, "ValueToken", "BVT");
    }

    function testAudit_SimplexOwnershipCannotBeTransferred() public {
        address newOwner = makeAddr("NEW OWNER");

        bool success;
        bytes memory returnData;

        vm.prank(owner);
        (success, ) = address(simplex).call(
            abi.encodeWithSelector(BaseAdminFacet.transferOwnership.selector, newOwner)
        );
        require(success, "Transfer Ownership failed");

        vm.prank(newOwner);
        (success, returnData) = address(simplex).call(
            abi.encodeWithSelector(BaseAdminFacet.acceptOwnership.selector)
        );
        // Ownership cannot be accepted
        assertFalse(success);

        (success, returnData) = address(simplex).call(
            abi.encodeWithSelector(BaseAdminFacet.owner.selector)
        );
        require(success, "Get owner failed");

        // The owner does not change
        address currentOwner = abi.decode(returnData, (address));
        assertEq(currentOwner, owner);
    }
}

Mitigation

Add acceptOwnership() to admin cut.

Diff
        {
-           bytes4[] memory adminSelectors = new bytes4[](3);
+           bytes4[] memory adminSelectors = new bytes4[](4);
            adminSelectors[0] = BaseAdminFacet.transferOwnership.selector;
            adminSelectors[1] = BaseAdminFacet.owner.selector;
            adminSelectors[2] = BaseAdminFacet.adminRights.selector;
+           adminSelectors[3] = BaseAdminFacet.acceptOwnership.selector;
            cuts[2] = FacetCut({
                facetAddress: address(new BaseAdminFacet()),
                action: FacetCutAction.Add,
                functionSelectors: adminSelectors
            });
        }

Discussion

sherlock-admin2

The protocol team fixed this issue in the following PRs/commits: https://github.com/itos-finance/Burve/pull/77

The original report as published on Sherlock, by 0L5S6W. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

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

Impact

The new pending owner cannot accept ownership, so ownership cannot be transferred.

What the attacker needed

Simplex owner initiates ownership transfer

The fix

The protocol team fixed this issue by adding acceptOwnership to the admin cut.

How it was found

  1. The current owner calls transferOwnership on the SimplexDiamond, setting a pending owner.
  2. The pending owner calls acceptOwnership on the SimplexDiamond.
  3. The call fails because acceptOwnership is not registered in the diamond.
  4. The owner remains unchanged.

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.

This is a smart contract bug where a two-step ownership transfer is broken. The contract lets the current owner start a transfer, but the new owner cannot complete it because the function to accept is missing. So the owner never changes.

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 0L5S6W

View all

4 more disclosed reports, best first.

More from Burve

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.