SSSwap

First Flight #41
Beginner FriendlyRust
100 EXP
View results
Submission Details
Impact: high
Likelihood: high
Invalid

Price Manipulation Vulnerability in Swap Functions

Description: The AMM is vulnerable to price manipulation attacks due to lack of proper slippage control and sandwich attack protection. In the swap_operations::swap_exact_in and swap_operations::swap_exact_out functions, while there are slippage parameters, there's no mechanism to prevent front-running or sandwich attacks.

Impact: Attackers can front-run user transactions, manipulate the pool price, and then back-run to profit at the expense of regular users. This can lead to significant financial losses for users.

Proof of Concept:

  1. Monitor mempool for pending swap transactions

  2. Front-run with a large swap to move price significantly

  3. Let victim's transaction execute at unfavorable rate

  4. Back-run to restore price and profit from the difference

Recommended Mitigation: Implement additional protections:

  1. Add minimum time-to-live for transactions

  2. Implement price oracles to detect significant deviations

  3. Consider implementing a virtual reserves mechanism to make manipulation more costly

Updates

Lead Judging Commences

0xtimefliez Lead Judge 14 days ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.