58215 sc high funds can become permanently stuck in adapter when kill switch is enabled
Submitted on Oct 31st 2025 at 13:01:14 UTC by @mohitisimmortal for Audit Comp | Alchemix V3
Report ID: #58215
Report Type: Smart Contract
Report severity: High
Target: https://github.com/alchemix-finance/v3-poc/blob/immunefi_audit/src/MYTStrategy.sol
Impacts:
Permanent freezing of funds
Description
Summary:
When killSwitch is enabled in the adapter (MYTStrategy), the adapter does not allocate funds, but the Morpho vault still transfers collateral to the adapter. Because no recovery or fallback mechanism exists, these funds become irrecoverably stuck inside the adapter contract. Disabling killSwitch and attempting deallocate does not help because no allocation took place, so there is nothing to unwind, leaving the vault with a permanent loss.
Description:
Allocation flow:
AlchemistAllocator.allocate() → calls Morpho vault.
Morpho vault executes allocateInternal().
allocateInternal() transfers assets to adapter and then calls the adapter’s allocate() function:
Bug condition:
If killSwitch == true in the adapter:
The asset transfer still happened, but the adapter does not allocate into any strategy.
No recover() or fallback logic exists.
Funds remain stuck in the adapter contract.
Later, when attempting deallocate(), it fails to return funds because:
Nothing was allocated → nothing to unwind → still stuck.
Impact:
Permanent loss/stuck of vault asset.
Likelihood:
killswitch is rarely be true, but as many strategies are there, so medium-high likelihood is possible.
Recommendation:
Implement a recovery path for funds when killSwitch is active.
Option A : Add recover() function in adapter:
Option B: Modify allocate() to immediately return transferred funds when killSwitch == true:
Option C: During deallocate(), detect unallocated idle balance and transfer directly back to Morpho vault.
Proof of Concept
Proof of Concept
add below import and testcase into
AlchemistAllocator.t.sol:
run by
forge test --mt testfundsStuckInAdapter -vvvvoutput:
Was this helpful?