Missing slippage checks
The smart contract functions lacked minimum output amount checks, allowing an attacker to sandwich transactions and cause large slippage. An attacker with sufficient capital could force nearly 100% slippage.
Submitted by cmichel, also found by tensors
There are no minimum amounts out, or checks that frontrunning/slippage is sufficiently mitigated. This means that anyone with enough capital can force arbitrarily large slippage by sandwiching transactions, close to 100%. See issue page for referenced code.
Recommend adding a minimum amount out parameter. The function reverts if the minimum amount isn’t obtained.
verifyfirst (Spartan) acknowledge:
We acknowledge the issue for the protocol’s AMM, but if this becomes a large issue in the future, the router is easily upgradeable to include a minimum rate parameter.
SamusEldburg (Spartan) confirmed and disagreed with severity:
Have changed this to confirmed; even though we already were aware of it; we have discussed and are happy to add in a UI-handed arg for minAmount now rather than reactively in the future. Disagree with severity though; this wasn’t a problem with V1 at all.
I’ll keep high risk as sandwich attacks are very common and risk of getting a bad swap is real.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
An attacker with enough capital could force arbitrarily large slippage, close to 100%, by sandwiching transactions.
What the attacker needed
Sufficient capital to sandwich; victim trades on the AMM
The fix
The protocol should add a minimum amount out parameter that reverts if the minimum is not obtained.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When you swap tokens on a decentralised exchange, you can set a minimum amount you are willing to receive. Without that, someone can see your trade and place their own trades before and after yours to manipulate the price, causing you to get much less than expected. This is called a sandwich attack.
What is Business logic?
The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.