Skip to content
Business logic Audit finding Intermediate

Assets are not accounted for when the contract is in killswitch mode

When the MYTStrategy contract is in killSwitch mode, its allocate function returns early without reverting, so assets sent to it are not recorded in the vault's allocation or the strategy's total assets. An attacker or admin could transfer assets to the strategy and they would become permanently stuck.

ayden Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

57532 sc high assets are not accounted for when the contract is in killswitch mode

Submitted on Oct 27th 2025 at 00:38:34 UTC by @ayden for Audit Comp | Alchemix V3

Description

Brief/Intro

In killSwitch mode, the allocation step is skipped without reverting. As a result, assets can be transferred from the Morpho V2 Vault to the MYTStrategy contract. However, these transferred assets are not recorded in the Morpho V2 Vault’s allocation, nor are they included in the total assets of the MYTStrategy contract.

Vulnerability Details

Solidity
    function allocate(bytes memory data, uint256 assets, bytes4 selector, address sender)
        external
        onlyVault
        returns (bytes32[] memory strategyIds, int256 change)
    {
        if (killSwitch) {
            return (ids(), int256(0)); <<<<<
        }

Impact Details

If user transfer assets to a killSwitch mode Strategy , the assets become stuck

References

Proof of Concept

Proof of Concept

add following test to AlchemistAllocator.t.sol contract.

Solidity
    function test_KillSwitchMode() public {
        address user = makeAddr("user");

        _magicDepositToVault(address(vault), user, 10e18);

        vm.startPrank(admin);
        bytes32 allocationId = mytStrategy.adapterId();

        //admin allocate 5e18 assest to mytStrategy contract.
        allocator.allocate(address(mytStrategy), 5e18);

        //admin user set mytStrategy to killSwitch Mode.
        mytStrategy.setKillSwitch(true);

        //admin allocate another 5e18 assest to mytStrategy contract.
        allocator.allocate(address(mytStrategy), 5e18);

        uint256 allocation = vault.allocation(allocationId);

        //the allocation is still 5e18.
        assertEq(allocation, 5e18);
        assertEq(TestERC20(mockVaultCollateral).balanceOf(address(vault)),0);
        assertEq(TestERC20(mockVaultCollateral).balanceOf(address(mytStrategy)),5e18);
    }

The original report as published on Immunefi, by ayden. 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 allocate function returns early when killSwitch is true instead of reverting, so incoming assets are accepted but not accounted for.

Impact

Assets transferred to a killSwitch-mode strategy become permanently stuck, causing permanent freezing of funds.

What the attacker needed

Strategy in killSwitch mode; assets allocated to the strategy

The fix

The allocate function should revert when killSwitch is true instead of returning early, so assets cannot be transferred without being accounted for.

How it was found

  1. Deposit collateral into the vault for a user.
  2. Allocate 5e18 assets to the MYTStrategy contract.
  3. Set the MYTStrategy contract to killSwitch mode.
  4. Allocate another 5e18 assets to the MYTStrategy contract.
  5. Observe that the vault's allocation remains 5e18 while the strategy holds 5e18 assets.

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 can have a 'kill switch' that stops it from doing its main job. Here, when the switch is on, the contract quietly ignores new money instead of refusing it. That money gets stuck because the contract's records don't show it.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by ayden

View all

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

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.