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:
Monitor mempool for pending swap transactions
Front-run with a large swap to move price significantly
Let victim's transaction execute at unfavorable rate
Back-run to restore price and profit from the difference
Recommended Mitigation: Implement additional protections:
Add minimum time-to-live for transactions
Implement price oracles to detect significant deviations
Consider implementing a virtual reserves mechanism to make manipulation more costly
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.