Skip to content
Business logic Audit finding Intermediate

Funds gets stuck even when killswitch is enabled

When the killswitch is enabled on the strategy, the strategy's allocate function returns no change, but the Morpho vault still transfers assets to the adapter. Those funds then cannot be deallocated while the killswitch remains on, so they are stuck.

shadowHunter Follow

Originally disclosed on Immunefi

  • Disclosed after under an hour

57849 sc high funds gets stuck even when killswitch is enabled

Submitted on Oct 29th 2025 at 08:03:41 UTC by @shadowHunter for Audit Comp | Alchemix V3

Description

Brief/Intro

Even if killSwitch is enabled by Owner, funds gets transferred from Vault to Adaptor in case of allocation. These funds remain stuck with no way to deallocate until killSwitch is turned off

Vulnerability Details

  • If killSwitch is true on MYTStrategy and allocation is done then MYTStrategy correctly make 0 changes
if (killSwitch) {
            return (ids(), int256(0));
        }
  • But still Morpho vault which ignores if any changes were made to id, will send funds from vault to the MYTStrategy adaptor. This should be unexpected
https://github.com/morpho-org/vault-v2/blob/406546763343b9ffa84c2f63742ae55a490b7c42/src/VaultV2.sol#L576
function allocateInternal(address adapter, bytes memory data, uint256 assets) internal {
        require(isAdapter[adapter], ErrorsLib.NotAdapter());

        accrueInterest();

        SafeERC20Lib.safeTransfer(asset, adapter, assets);
        (bytes32[] memory ids, int256 change) = IAdapter(adapter).allocate(data, assets, msg.sig, msg.sender);
  • Also now you cannot deallocate this stuck funds until owner turns kill switch off which may not even happen (since adaptor does not approve funds to vault due to early exit)
 function deallocate(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

Funds get stuck in adaptor

Recommendation

Allocator should not call vault if kill switch is enabled

Proof of Concept

Proof of Concept

Place this in MYTStrategy.t.sol test suit

function test_killSwitchPreventsAllocation() public {
        //  Enable kill switch
         vm.prank(admin);
         strategy.setKillSwitch(true);

        //  Vault should fail to allocate
         vm.prank(address(vault));
         vm.expectRevert(bytes("emergency"));
         strategy.allocate(abi.encode(0), 100e18, bytes4(0x00000000), address(allocator));
     }

Ouput:

Encountered 1 failing test in src/test/MYTStrategy.t.sol:MYTStrategyTest
[FAIL: next call did not revert as expected] test_killSwitchPreventsAllocation() (gas: 50021)

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

Likely the vault's allocate flow transfers assets to the adapter before calling it and does not check whether the adapter actually accepted them, so the strategy's zero-change response is ignored.

Impact

Funds sent to the adapter while the killswitch is on become temporarily frozen and cannot be recovered until the owner disables the killswitch.

What the attacker needed

Killswitch enabled by owner; allocator triggers an allocation

The fix

The allocator should not call the vault's allocate function while the killswitch is enabled.

How it was found

  1. Enable the killswitch on the strategy as the admin.
  2. Trigger an allocation from the vault to the strategy adapter.
  3. Observe that the vault still transfers the assets to the adapter.
  4. Attempt to deallocate and see that the strategy returns early, leaving the funds stuck.

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 vault hands money to a helper contract (an adapter) to invest it. The owner can flip a 'killswitch' to stop new investments, but the vault still sends money to the helper anyway. Because the helper refuses to do anything while the switch is on, that money cannot be moved back out.

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 shadowHunter

View all

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