58534 sc high zero slippage protection in toke strategies allocation

Submitted on Nov 3rd 2025 at 04:01:33 UTC by @nem0thefinder for Audit Comp | Alchemix V3arrow-up-right

  • Report ID: #58534

  • Report Type: Smart Contract

  • Report severity: High

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

  • Impacts:

    • Direct theft of any user funds, whether at-rest or in-motion, other than unclaimed yield

    • Unprotected allocations lose user funds

Description

Note! The same apply for TokeAutoEth

Summary

The _allocate() function accepts zero shares from the AutoUSD vault by setting minSharesOut = 0 in the router.depositMax() call. This allows the strategy to lose up to 100% of deposited funds through price manipulation, sandwich attacks, or unfavorable market conditions without any transaction revert

Description

The vulnerability exists in the following code:

The depositMax() function's third parameter (minSharesOut) is hardcoded to 0, which means the function will accept any amount of shares returned, including:

  • Zero shares (100% loss)

  • Extremely small amounts due to slippage

  • Manipulated amounts from MEV attacks

Impact

  1. Sandwich Attack (89%+ loss)

    • Attacker front-runs the allocation transaction

    • Inflates the AutoUSD vault share price via large donation or manipulation

    • Strategy receives drastically fewer shares for the same USDC amount

    • Attacker back-runs to extract profit

    • Demonstrated loss: 89.53% of funds

  2. Price Manipulation (100% loss possible)

    • Malicious actor manipulates vault state before strategy deposit

    • Router returns zero shares due to rounding or extreme price manipulation

    • Strategy accepts the zero shares and proceeds

    • Result: Complete loss of deposited USDC

  3. Unfavorable Market Conditions (Variable loss)

    • Sudden market volatility causes poor exchange rates

    • No minimum threshold to protect against extreme slippage

    • Strategy unknowingly accepts substantial losses

Mitigation

  • Accept minSharesOut as function param and pass it to depositMax to have dynamic slippage on each allocation

Proof of Concept

Proof of Concept

Note! The following steps applied to TokeAutoUSDCStrategy.t.sol

1. Paste the following test

2. Run it via `forge test --mc TokeAutoUSDStrategyTest --mt test_POC_acceptAnyShares -vvv

`

Logs

Was this helpful?