# Functions in the VotiumStrategy contract are susceptible to sandwich attacks

VotiumStrategy's buyCvx/sellCvx call Curve exchange_underlying with min_dy=0, letting attackers sandwich direct deposits/withdrawals and steal value.

- Payout: Contest reward
- Severity: high
- Program: Asymmetry Finance
- Credited: MiloTruck
- Disclosed: 2024-02-06
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2023-09-asymmetry-findings/issues/23
- Library page: https://bugbountylibrary.com/r/c4%3A2023-09-asymmetry%3AH-05
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:high tech:evm tech:solidity technique:source-review vuln:business-logic

**Target:** VotiumStrategy / VotiumStrategyCore smart contracts
**Root cause:** buyCvx() and sellCvx() call Curve's exchange_underlying() with _min_dy set to 0, providing no slippage protection for direct callers of deposit(), depositRewards(), and withdraw().
**Steps:**
1. Bob calls VotiumStrategy.deposit() directly with ETH.
2. Alice front-runs by swapping large ETH into Curve ETH/CVX pool via exchange_underlying(0,1,amount,0).
3. Bob's tx executes buyCvx() with min_dy=0, receiving less CVX due to manipulated pool ratio.
4. Alice back-runs by swapping CVX back to ETH, profiting from the price impact.
**How found:** Code review identified that exchange_underlying() is called with _min_dy=0 in buyCvx() and sellCvx(), and that while AfEth.deposit/withdraw pass _minOut, direct calls to VotiumStrategy functions lack slippage protection.
**Exploitation:** Attacker observes a victim's direct call to VotiumStrategy.deposit(), depositRewards(), or withdraw() in the mempool, front-runs with a large swap in the Curve ETH/CVX pool to skew the price, lets the victim's swap execute at the worsened rate (min_dy=0), then back-runs to restore the price and capture profit.
**Insight:** When a strategy contract exposes public deposit/withdraw functions that perform swaps, check whether slippage parameters are hardcoded to zero; even if a wrapper contract provides protection, direct interaction paths may be vulnerable.
