Slippage tolerance not enforced in tokeautousdstrategy
The TokeAutoUSDStrategy calls the router's depositMax with a minimum-shares-out value of zero, so a deposit can complete even when far fewer vault shares are received than expected. This exposes MYT users to excess slippage and a loss of the funds backing the token.
- Disclosed after under an hour
58010 sc high slippage tolerance not enforced in tokeautousdstrategy
Submitted on Oct 30th 2025 at 00:11:10 UTC by @SOPROBRO for Audit Comp | Alchemix V3
- Report ID: #58010
- 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
Description
Brief/Intro
The TokeAutoUSDStrategy lacks slippage protection when allocating funds, as it calls router.depositMax with minSharesOut = 0. This allows deposits to proceed even if far fewer shares are received than expected, resulting in MYT users potentially suffering losses due to under-collateralization.
Vulnerability Details
The DAO manages allocation, and if it decides to allocate into TokeAutoUSDStrategy, the flow goes from MYTStrategy::allocate -> TokeAutoUSDStrategy::_allocate -> router.depositMax. The following parameters are used to call depositMax:
uint256 shares = router.depositMax(autoUSD, address(this), 0);
The problem is that it sets the minSharesOut as 0. See the code in Etherscan(1), which is enforced in AutopilotRouterBase, when depositing into the vault:
if ((sharesOut = vault.deposit(amount, to)) < minSharesOut) {
revert MinSharesError();
}
From the docs of Auto Finance, we can see that slippage is expected, and they state(2) :
Depending on the conditions of the Autopool, the overall market, and the timing of the debt reporting process slippage may be encountered on both entering and exiting the Autopool. It is very important to always check the shares received on entering, and the assets received on exiting, are greater than an expected amount.
Therefore, not enforcing a minSharesOut will subject MYT users to excess slippage, resulting in loss of funds backing the MYT.
Note: This is also found in
TokeAutoEth.sol
Impact Details
The impact of this is a loss of funds for MYT users, resulting in system-wide liquidation due to the Meta-Yield Token itself losing backing. Therefore, I believe this is high severity, as the vault opens itself up to a slippage, and other slippage-type attacks due to the lack of slippage enforcement.
References
(1) https://etherscan.io/address/0x37dd409f5e98ab4f151f4259ea0cc13e97e8ae21#code#F1#L95
(2) https://docs.auto.finance/developer-docs/integrating/4626-compliance#slippage
Proof of Concept
Proof of Concept
Add the following imports to TokeAutoUSDStrategy.t.sol
import "forge-std/Test.sol";
import {IERC4626} from "../../../lib/openzeppelin-contracts/contracts/interfaces/IERC4626.sol";
Then add the following test, and run in the console forge test --mt test_allocate_shares_slippage -vv.
function test_allocate_shares_slippage() public {
uint256 amountToAllocate = 1e18;
vm.startPrank(vault);
// Fund the strategy
deal(testConfig.vaultAsset, strategy, amountToAllocate);
// Reference the real AutoUSD vault
IERC4626 autoUSD = IERC4626(TOKE_AUTO_USD_VAULT);
uint256 stakedSharesBefore = IERC20(address(autoUSD)).balanceOf(REWARDER);
uint256 fakeShares = amountToAllocate / 2; // simulate slippage
vm.mockCall(
AUTOPILOT_ROUTER,
abi.encodeWithSelector(bytes4(keccak256("depositMax(address,address,uint256)")), TOKE_AUTO_USD_VAULT, address(strategy), 0),
abi.encode(fakeShares)
);
// Mint fakeShares to the strategy
deal(address(autoUSD), address(strategy), fakeShares);
// --- Allocate via strategy ---
bytes memory prevAlloc = abi.encode(0);
IMYTStrategy(strategy).allocate(prevAlloc, amountToAllocate, "", address(vault));
// --- Check how many shares got staked ---
uint256 stakedSharesAfter = IERC20(address(autoUSD)).balanceOf(REWARDER);
console.log("Staked shares (slipped): %e", stakedSharesAfter - stakedSharesBefore);
}
A mockCall was used to mimic the router returning less shares than expected, which would usually be checked if slippage was enforced. However, we can see that the code continued, and only half of what was allocated was sent to the rewarder.
Logs:
Staked shares (slipped): 5e17
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
The strategy passes a minimum-shares-out of zero to the router deposit call, so no slippage check is performed on the shares received.
Impact
MYT users could lose funds because the token loses backing, potentially leading to system-wide liquidation; the report notes the same issue exists in TokeAutoEth.sol.
What the attacker needed
DAO allocates funds into the strategy; Adverse slippage on the Autopool
The fix
The strategy should pass a sensible non-zero minimum-shares-out value to depositMax so that deposits revert when slippage exceeds the accepted limit.
How it was found
- Fund the strategy with the asset to allocate.
- Mock the router so depositMax returns only half the expected shares.
- Call allocate on the strategy with the amount.
- Observe that the call succeeds and only the reduced share amount is staked.
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.
When money is put into a vault, the amount of shares you get back can vary with market conditions, so a safe contract sets a minimum it will accept. This strategy set that minimum to zero, meaning it would accept any amount of shares, even a tiny fraction of what was expected. An attacker or simply bad market timing could then leave the protocol holding less value than it put in.
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.