# Stableswap pools can have price changes even when swaps are killed

Stableswap pool kill_swap freeze bypassed via withdraw_one_coin/remove_liquidity_imbalance, letting a user drain 84% of token0 and skew pool price.

- Payout: Contest reward
- Severity: medium
- Program: Aquarius
- Credited: carrotsmuggler
- Disclosed: 2025-09-01
- Write-up quality: 7/10
- Original: https://cdn.cantina.xyz/reports/cantina_competition_aquarius_aug2025.pdf#3.2.7
- Library page: https://bugbountylibrary.com/r/cantina%3Aaquarius_aug2025%3A3.2.7
- Tags: domain:web3 impact:funds-loss impact:integrity kind:contest platform:cantina sev:medium tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** Soroban stableswap liquidity pool contract
**Root cause:** kill_swap only blocks swap entrypoints, but withdraw_one_coin and remove_liquidity_imbalance perform internal swaps, so user-chosen withdrawal composition still moves pool price.
**Steps:**
1. Deploy stableswap pool, admin deposits `(1e7, 1e7)`; user deposits `(1e7, 1e7)` receiving 20000000 shares.
2. Admin calls `kill_swap`; `get_is_killed_swap` returns true.
3. User calls `withdraw_one_coin(user, share_balance, 0, 0)` to withdraw all shares as token0 only.
4. Observe reserves change from `[20000000, 20000000]` to `[3115030, 20000000]`, ratio 1 -> 0.1557515; user received 16884970 token0 (84%).
**How found:** Reasoned that kill_swap assumes proportional withdrawals keep reserves ratio fixed (true for constant-product), then noticed stableswap exposes user-composed withdrawal functions that internally swap, breaking that invariant.
**Exploitation:** During an emergency freeze (e.g. one token exploited), an LP front-runs other withdrawers by calling withdraw_one_coin to exit entirely in the healthy token, leaving remaining LPs holding the bad token.
**Insight:** When auditing emergency pause/kill switches, enumerate every entrypoint that mutates reserves indirectly (imbalanced/one-sided withdrawals, add/remove LP) not just the obvious swap function; stableswap math makes these equivalent to swaps.
