Funds are permanently locked when allocating to a strategy with an active killSwitch. The vault transfers assets to the strategy, but the strategy returns early without allocating them to the underlying protocol. The vault's allocation tracking remains at zero, making the funds unrecoverable through normal deallocation flow. No emergency rescue mechanism exists.
Description
The bug occurs in the interaction between AlchemixAllocator, VaultV2, and MYTStrategy:
AlchemixAllocator.allocate() does not check the strategy's killSwitch status
AlchemixAllocator.sol:
VaultV2.allocateInternal() transfers funds to the strategy
VaultV2.sol:
MYTStrategy.allocate() returns (ids(), 0) when killSwitch is true MYTStrategy.sol:
Funds remain in the strategy contract as underlying tokens
vault.allocation(id) stays at 0 because the returned change is 0
Deallocation is impossible because it requires allocation > 0
Execution Flow
Impact
Permanent fund lock: Allocated funds remain in the strategy contract indefinitely
Broken accounting: Vault tracking shows zero allocation despite funds being transferred
No recovery mechanism:
Deallocation requires allocation > 0 but it remains 0
No emergency withdrawal function exists in MYTStrategy
Funds cannot be transferred back to vault
Mitigation
Add killSwitch validation in AlchemixAllocator.allocate() before initiating the allocation:
Proof of Concept
Proof of Concept
1.import the following in AlchemistAllocator.t.sol
2.paste the following test in AlchemistAllocator.t.sol
3.Run it via `forge test --mc AlchemistAllocatorTest --mt test_Funds_Stuck_DueTo_KillSwitch --rpc-url https://arbitrum.gateway.tenderly.co -vvv