sherlock-audit / 2024-05-beefy-cowcentrated-liquidity-manager-judging

5 stars 5 forks source link

Sparrow_Jac - Potential for Price Manipulation in Using `slot0` to Obtain `sqrtPriceX96` #41

Closed sherlock-admin2 closed 5 months ago

sherlock-admin2 commented 5 months ago

Sparrow_Jac

high

Potential for Price Manipulation in Using slot0 to Obtain sqrtPriceX96

Summary

This report details a vulnerability in decentralized exchange protocols that rely on liquidity pools, specifically focusing on the manipulation of the sqrtPriceX96 value obtained from the slot0 function. This vulnerability can be exploited through Miner Extractable Value (MEV) strategies, flash loans, and sandwich attacks, potentially leading to significant financial losses for users interacting with affected functions.

Vulnerability Detail

The core of the vulnerability lies in the reliance on the slot0 function, which provides the most recent data point for several key state variables, including sqrtPriceX96. This data point can be manipulated by attackers using various techniques:

Duplicate of #10