# No slippage control when withdrawing a position leads to loss of funds

Superposition removed decr_position's slippage params, so withdrawals via update_position_C_7_F_1_F_740 with negative delta can be sandwiched, causing victim fund loss.

- Payout: Audit contest
- Severity: high
- Program: Superposition
- Found by: DadeKuma
- Disclosed: 2025-01-07
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2024-10-superposition-findings/issues/2
- Library page: https://bugbountylibrary.com/r/c4%3A2024-10-superposition%3AH-03
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:code4rena sev:high tech:solidity technique:source-review vuln:business-logic vuln:oracle-manipulation

**Target:** Seawater AMM position withdrawal function (update_position_C_7_F_1_F_740)
**Root cause:** The decr_position_09293696 function with amount_0_min/amount_1_min slippage bounds was removed; the only withdrawal path is update_position_C_7_F_1_F_740 with negative delta, which enforces zero minimum output.
**Steps:**
1. User withdraws by calling `update_position_C_7_F_1_F_740` with a negative delta (no min-out params).
2. Attacker observes pending withdrawal in mempool/sequencer.
3. Attacker front-runs to skew pool price against the withdrawal.
4. Withdrawal executes at manipulated price with no slippage check.
5. Attacker back-runs to restore price and captures the difference.
**How found:** Code review noting decr_position_09293696 (which had amount_0_min/amount_1_min) was removed entirely, leaving only update_position_C_7_F_1_F_740 with negative delta and no slippage parameters.
**Exploitation:** Sandwich attack: front-run the victim's withdrawal to move pool price, let the unprotected withdrawal execute at the worse price, then back-run to profit at the victim's expense.
**Insight:** When a protocol removes a function, check whether safety parameters (min-out bounds) it carried were reimplemented in the replacement path; withdrawal-only paths with zero min-out are sandwichable even on sequencer-based L2s.

