Front-running vulnerability in pool price setting function #52
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
grade-b
primary issue
Highest quality submission among a set of duplicates
Q-12
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
🤖_primary
AI based primary recommendation
🤖_18_group
AI based duplicate group recommendation
sponsor acknowledged
Technically the issue is correct, but we're not going to resolve it for XYZ reasons
sufficient quality report
This report is of sufficient quality
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
The text was updated successfully, but these errors were encountered: