Open howlbot-integration[bot] opened 2 months ago
We're not going to resolve this because this function will be used by the DAO in the event that a price becomes stuck, or in a programmatic context (maybe the setting of odds for example).
The submission states that a direct price adjustment via an administrative action might be insecure to perform and may ultimately be exploited, however, the issue relies on the administrator making a mistake (i.e. updating the square root price without pausing the pool beforehand).
While restrictions might be imposed on when the function can be invoked, it remains an administrative function that we expect the Sponsor to responsibly utilize per the relevant SC verdicts rendering this submission to be a QA recommendation.
alex-ppg changed the severity to QA (Quality Assurance)
alex-ppg marked the issue as grade-c
alex-ppg marked the issue as grade-b
Lines of code
https://github.com/code-423n4/2024-08-superposition/blob/4528c9d2dbe1550d2660dac903a8246076044905/pkg/seawater/src/lib.rs#L1089
Vulnerability details
The
SeawaterAMM
contract contains a functionsetSqrtPriceFF4DB98C()
that allows the admin to change the price of a pool. However, this function is vulnerable to front-running attacks, allowing malicious actors to profit from the price change. The core issue lies in the atomic nature of the price change. Once an admin submits a transaction to change the price, this intention becomes visible in the mempool before it's executed. This window of visibility allows attackers to craft and submit their own transactions that will be executed before the price change, effectively allowing them to trade with foreknowledge of the future price.Impact
Direct financial exploitation:
Proof of Concept
setSqrtPriceFF4DB98C()
.Tools Used
Manual review
Recommended Mitigation Steps
Ensure that the pool is not enabled before changing the price.
Assessed type
Other