lack of slippage protection for increaseLiquidity
, and decreaseLiquidity
#41
Labels
2 (Med Risk)
Assets not at direct risk, but function/availability of the protocol could be impacted or leak value
bug
Something isn't working
duplicate-2
satisfactory
satisfies C4 submission criteria; eligible for awards
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
The text was updated successfully, but these errors were encountered: