slot0 is being used to calculate sensitive information which can be easily manipulated.
Vulnerability Detail
slot0 is used in two instances to calculate sqrtPriceX96, which is the current square root price in X96 representation. An attacker can take advantage of this through use of flash loans to sandwich attack users.
crypticdefense
medium
slot0
can be easily manipulatedSummary
slot0
is being used to calculate sensitive information which can be easily manipulated.Vulnerability Detail
slot0
is used in two instances to calculatesqrtPriceX96
, which is the current square root price in X96 representation. An attacker can take advantage of this through use of flash loans to sandwich attack users.Impact
User is sandwiched (frontrunned),
Code Snippet
https://github.com/sherlock-audit/2024-02-leverage-contracts/blob/main/wagmi-leverage/contracts/LightQuoterV3.sol#L207-L208
https://github.com/sherlock-audit/2024-02-leverage-contracts/blob/main/wagmi-leverage/contracts/abstract/LiquidityManager.sol#L345
Tool used
Manual Review
Recommendation
Use UniswapV3 TWAP or Chainlink Price Oracle.
Duplicate of #1