<!-- canonical: https://0xsimao.com/findings/clip-finance-ii-price-manipulation-route-through -->

# PHyperLPoolSwapInside::_swapWithCustomData() checks price manipulation for pool, but the router used may route through another pool

Low/Info · Three Sigma · DeFi infrastructure · 15th March 2024

Finding 3S-Clip-L05 of the Clip Finance Strategy Upgrade security review.

- Protocol: https://www.clip.finance/
- Report: /reports/clip-finance-strategy-upgrade
- Source: https://github.com/0xsimao/audits/blob/main/Three%20Sigma/2024-03-15-clip-finance-ii.pdf

---

### Description

[PHyperLPoolSwapInside::_swapWithCustomData()](https://github.com/ClipFinance/StrategyRouter-private/pull/107/files#diff-023946f07f510e865612a28a9a222e00f0f6b90a253fd981e9bf4f7656f5497fR581) checks price manipulation for pool;
however, the router chosen may route through a different pool, rendering the price
manipulation useless and leading to MEV.

### Recommendation

Either enforce that the router used routes through the pool or do the price manipulation
check for the pool that the router routed through.

### Status

Acknowledged

Disclosed by 0xSimao (https://0xsimao.com/).

---

Related findings:

- [Potential overflow in PancakeSwapPlugin:getRoutePrice()](https://0xsimao.com/findings/clip-finance-i-overflow-pancake-plugin-price): Clip Finance Strategies
- [Attacker may frontrun SyrupRouter::depositWithPermit() call and use a different depositData_ as it is not signed](https://0xsimao.com/findings/maple-finance-syrup-router-frontrun-deposit-permit-different): Maple Syrup Router
- [Borrower deposit, withdraw, deposit will reinit `omniChainData.cdsPoolValue`, getting profit stuck for cds depositors](https://0xsimao.com/findings/autonomint-deposit-withdraw-reinit-stuck): Autonomint
- [An attacker can manipulate `omniChainData.cdsPoolValue` by breaking protocol.](https://0xsimao.com/findings/autonomint-manipulate-omni-data-breaking): Autonomint
