Backstop bid-side frozen by tick-size constraint
A backstop order book enforces maker-only orders and a tick-size grid, so an attacker can place a sell backstop at the lowest legal price and block all future buy backstops. This freezes the bid side of the backstop book, which may prevent liquidations from relying on backstop bids.
Submitted by 0xPhantom, also found by 0xShitgem, dimulski, SeveritySquad, and taticuvostru
Backstop orders are restricted to maker-only:
// contracts/perps/types/Market.sol:141
if (bookType == BookType.BACKSTOP && args.tif != TiF.MOC) revert InvalidBackstopOrder();
Maker orders (TiF.MOC) revert whenever they would immediately match:
// contracts/perps/types/CLOBLib.sol:246
if (ds.getBestAsk() <= newOrder.price) {
if (tif == TiF.MOC) revert PostOnlyOrderWouldBeFilled();
}
Backstop prices must respect the book tick size:
// contracts/perps/types/Book.sol:86
if (price % StorageLib.loadBookSettings(self.config.asset).tickSize != 0) revert OrderPriceOutOfBounds();
Attack: The Buy side of the backstop orderbook an attacker place a SELL backstop with price = tickSize. That becomes getBestAsk(). Any future BUY backstop must choose a price >= tickSize; otherwise it’s below the tick step.
The first legal price equals the best ask, so _executeBuyOrder always detects crossing and reverts with PostOnlyOrderWouldBeFilled. Bids cannot be added until the attacker cancels or the order fills, effectively DoSing the bid side of the backstop book.
If no backstop bids exist, liquidations cannot rely on the backstop.
Recommended mitigation steps
Add a one-tick buffer for post-only backstop orders.
View detailed Proof of Concept
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
Root cause
Likely the post-only check compares against the best ask without leaving a one-tick gap, so the lowest legal bid price always crosses an existing ask at the same tick.
Impact
The bid side of the backstop book can be blocked, so liquidations may not be able to rely on backstop bids while the attacker's order stands.
What the attacker needed
Ability to place a backstop sell order; no existing backstop bids at that tick
The fix
The report recommends adding a one-tick buffer for post-only backstop orders.
How it was found
- Place a SELL backstop order priced at one tick size.
- That order becomes the best ask in the backstop book.
- Any BUY backstop must now price at or above that tick.
- The buy order crosses the ask and reverts as post-only.
- Bids stay blocked until the attacker cancels or the order fills.
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 backstop order is a standing order meant to catch liquidations. The code only lets these orders sit in the book if they would not trade immediately, and prices must land on fixed steps called the tick size. By placing a sell order at the smallest allowed step, the attacker makes every legal buy price cross it, so no buy backstop can be added.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.