Skip to content
Business logic Audit finding Intermediate

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.

Picodes Follow

Originally disclosed on Code4rena

Submitted by Picodes, also found by cccz, Funen, ladboy233, Soosh, and zzzitron

https://github.com/Plex-Engineer/lending-market-v2/blob/ea5840de72eab58bec837bb51986ac73712fcfde/contracts/Stableswap/BaseV1-periphery.sol#L86

The ensure modifier is commented, so deadlines will not work when passing orders, breaking this functionality.

nivasan1 (Canto) acknowledged

Alex the Entreprenerd (judge) commented:

The warden has shown how, due to a comment, the modifier deadline doesn’t work.

Because Front-running is a key aspect of AMM design, deadline is 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.


The original report as published on Code4rena, by Picodes. Images and videos are our own copies; raw HTML is shown as text. View it on Code4rena.

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.

More by Picodes

View all

17 more disclosed reports, best first.

More from Canto v2 contest

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.