Stableswap - Deadline do not work
The deadline check in the Stableswap periphery contract was disabled because the ensure modifier was commented out. An attacker (e.g., a miner) could delay a transaction indefinitely, causing the user to suffer maximum slippage.
Submitted by Picodes, also found by cccz, Funen, ladboy233, Soosh, and zzzitron
The ensure modifier is commented, so deadlines will not work when passing orders, breaking this functionality.
Alex the Entreprenerd (judge) commented:
The warden has shown how, due to a comment, the modifier
deadlinedoesn’t work.Because Front-running is a key aspect of AMM design,
deadlineis a useful tool to ensure that your tx cannot be “saved for later”.Due to the removal of the check, it may be more profitable for a miner to deny the transaction from being mined until the transaction incurs the maximum amount of slippage.
The lack of deadline means that the tx can be withheld indefinitely at the advantage of the miner.
For those reasons I agree with Medium Severity.
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
A miner could withhold a transaction until it incurs maximum slippage, harming the user.
What the attacker needed
Transaction with a deadline parameter
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.
A deadline is a time limit on a transaction. If it is missing, someone can hold your transaction and execute it later when the price is worse for you. Here, a line of code that enforced the deadline was turned off, so the protection did not work.
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.