Lack of slippage protection for increasing and decreasing liquidity can cause the liquidity provider to provide liquidity at an unfavorable price. Or the borrower to borrow/repay in a manipulated pool.
Proof of Concept
When adding liquidity eventually calls comes down to LiquidityPosition::increaseLiquidity and decreaseLiquidity which interact with the Uniswap position manager:
Consider adding amount0/1Min parameters to ParticlePositionManager::increaseLiquidity and decreaseLiquidity and also through the calls openPosition, closePosition and liquidatePosition.
This would also cover the usage of slot0 in Base::getRequiredRepay as it would enforce a certain amount of token0/1 to be returned when repaying the liquidity.
Lines of code
https://github.com/code-423n4/2023-12-particle/blob/main/contracts/libraries/LiquidityPosition.sol#L190-L199 https://github.com/code-423n4/2023-12-particle/blob/main/contracts/libraries/LiquidityPosition.sol#L255-L261
Vulnerability details
Impact
Lack of slippage protection for increasing and decreasing liquidity can cause the liquidity provider to provide liquidity at an unfavorable price. Or the borrower to borrow/repay in a manipulated pool.
Proof of Concept
When adding liquidity eventually calls comes down to
LiquidityPosition::increaseLiquidity
anddecreaseLiquidity
which interact with the Uniswap position manager:LiquidityPosition::increaseLiquidity
anddecreaseLiquidity
:These are called directly by the liquidity provider through:
ParticlePositionManager::increaseLiquidity
andParticlePositionManager::decreaseLiquidity
.As well as indirectly when opening, closing or liquidating a position.
Tools Used
Manual audit
Recommended Mitigation Steps
Consider adding
amount0/1Min
parameters toParticlePositionManager::increaseLiquidity
anddecreaseLiquidity
and also through the callsopenPosition
,closePosition
andliquidatePosition
.This would also cover the usage of
slot0
inBase::getRequiredRepay
as it would enforce a certain amount oftoken0/1
to be returned when repaying the liquidity.Assessed type
MEV