This repository has been archived by the owner on Nov 5, 2023. It is now read-only.
0x52 - UniswapV3 sqrtRatioLimit doesn't provide slippage protection and will result in partial swaps #132
Labels
Has Duplicates
A valid issue with 1+ other issues describing the same vulnerability
High
A valid High severity issue
Reward
A payout will be made for this issue
Will Fix
The sponsor confirmed this issue will be fixed
0x52
high
UniswapV3 sqrtRatioLimit doesn't provide slippage protection and will result in partial swaps
Summary
The sqrtRatioLimit for UniV3 doesn't cause the swap to revert upon reaching that value. Instead it just cause the swap to partially fill. This is a known issue with using sqrtRatioLimit as can be seen here where the swap ends prematurely when it has been reached. This is problematic as this is meant to provide the user with slippage protection but doesn't.
Vulnerability Detail
https://github.com/sherlock-audit/2023-04-blueberry/blob/main/blueberry-core/contracts/spell/IchiSpell.sol#L209-L223
sqrtRatioLimit is used as slippage protection for the user but is ineffective and depending on what tokens are being swapped, tokens may be left the in the contract which can be stolen by anyone.
Impact
Incorrect slippage application can result in partial swaps and loss of funds
Code Snippet
IchiSpell.sol#L181-L236
Tool used
Manual Review
Recommendation
Check the amount received from the swap and compare it against some user supplied minimum
The text was updated successfully, but these errors were encountered: