56956 sc high lack of slippage control in tokemak strategies can make myt suffer losses on allocation

Submitted on Oct 22nd 2025 at 07:11:38 UTC by @Oxdeadmanwalking for Audit Comp | Alchemix V3arrow-up-right

  • Report ID: #56956

  • Report Type: Smart Contract

  • Report severity: High

  • Target: https://github.com/alchemix-finance/v3-poc/blob/immunefi_audit/src/strategies/mainnet/TokeAutoEth.sol

  • Impacts:

    • Theft of unclaimed yield

    • Lack of slippage control leading to loss of funds

Description

Brief/Intro

TokeAutoEthStrategy , upon an _allocate call, deposits assets to the AutopilotRouter to obtain shares and then stakes the shares to start generating rewards. Upon depositing however, the minSharesOut is hardcoded to 0 in the depositMax call which could lead to loss of funds due to on-chain slippage. The same issue applies to TokeAutoUsdStrategy as well.

Vulnerability Details

_allocate in TokeAutoEthStrategy calls depositMax with a minSharesOut always set to 0.

    // @dev Implementation can alternatively make use of a multicall
    // Deposit weth into the autoEth vault, stake the shares in the rewarder
    function _allocate(uint256 amount) internal override returns (uint256) {
        require(TokenUtils.safeBalanceOf(address(weth), address(this)) >= amount, "Strategy balance is less than amount");
        TokenUtils.safeApprove(address(weth), address(router), amount);
        // @audit min shares out are 0, lack of slippage control
        // https://docs.auto.finance/developer-docs/integrating/4626-compliance#slippage
@>  uint256 shares = router.depositMax(autoEth, address(this), 0);
        TokenUtils.safeApprove(address(autoEth), address(rewarder), shares);
        // @audit shares are never checked
        rewarder.stake(address(this), shares);
        return amount;
    }

As stated by the Tokemak documentation (https://docs.auto.finance/developer-docs/integrating/4626-compliance#slippage),

The code however never checks the shares received against an expected amount leaving allocations vulnerable to on-chain slippage which can occur naturally due to liquidity issues or mev epecially as the size of the allocation scales.

Impact Details

Shares received might be fewer than expected which can in turn redeem fewer assets than the amount allocated which causes loss of funds, potentially substancial.

References

https://docs.auto.finance/developer-docs/integrating/4626-compliance#slippage

Proof of Concept

Proof of Concept

We will test TokeAutoEthStrategy here but the same issue can be replicated for the USD strategy as well.

  1. In TokeAutoEthStrategy.t.sol add these lines before the contract declaration to import the required dependencies

  1. Then at the bottom of the file add this poc and helper function that simulates on-chain slippage.

  1. Run the test:

The test should pass successfully. As we can see, we mocked a slippage of 10% and received less shares than expected but the code did not perform any checks and the call succeeded. You should see this output in your console:

Slippage can occur for many reasons like tokemak outlines in their documentation since the underlying vaults perform complex strategies which could be subject to liquidity constraints.

Was this helpful?