Skip to content
Business logic Audit finding Intermediate

A malicious user can potentially escape liquidation by creating a dust amount position and trigger the liquidation by themself

A liquidated position can be reused for depositing and borrowing, but if a liquidation auction is already ongoing, triggering a new liquidation fails until the old auction is settled. An attacker can create a tiny position, trigger its liquidation, and then borrow a larger amount, hoping liquidators ignore the dust auction and thus fail to liquidate the real loan.

WatchPug Follow

Originally disclosed on Code4rena

Submitted by WatchPug, also found by jonah1005

In the current implementation, a liquidated position can be used for depositing and borrowing again.

However, if there is a liquidation auction ongoing, even if the position is now liquidatable, the call of triggerLiquidation() will still fail.

The liquidator must settleLiquidation first.

If the current auction is not profitable for the liquidator, say the value of the collateral can not even cover the gas cost, the liquidator may be tricked and not liquidate the new loan at all.

Considering if the liquidator bot is not as small to handle this situation (take the profit of the new liquidation and the gas cost loss of the current auction into consideration), a malicious user can create a dust amount position trigger the liquidation by themself.

Since the collateral of this position is so small that it can not even cover the gas cost, liquidators will most certainly ignore this auction.

The malicious user will then deposit borrow the actual loan.

When this loan becomes liquidatable, liquidators may:

  1. confuse the current dust auction with the liquidatable position;
  2. unable to proceed with such a complex liquidation.

As a result, the malicious user can potentially escape liquidation.

Recommendation

Consider making liquidated positions unable to be used (for depositing and borrowing) again.

ryuheimat (Mochi) confirmed

The original report as published on Code4rena, by WatchPug. 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

Root cause

Likely, the contract allows a position that is already in liquidation to be used again for depositing and borrowing, and it prevents triggering a new liquidation while an auction is ongoing.

Impact

The attacker could potentially escape liquidation, but this depends on liquidators being confused or unable to handle the situation.

What the attacker needed

A lending position; ability to create a dust position; liquidators ignore unprofitable auctions

The fix

The recommendation is to make liquidated positions unable to be used again for depositing and borrowing.

How it was found

  1. Create a very small position (dust amount) and trigger its liquidation.
  2. Since the collateral is too small to cover gas, liquidators ignore the auction.
  3. Deposit and borrow a larger amount using the same position.
  4. When the new loan becomes liquidatable, liquidators may be confused by the ongoing dust auction or unable to proceed with a complex liquidation.

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.

In some lending systems, when a loan becomes unsafe, anyone can start a liquidation auction to sell the collateral. This report shows that if a user has an old auction still running, they can open a new loan and later, when that loan becomes unsafe, liquidators might be confused or unable to act because the old auction is still there. The user might then avoid having their loan liquidated.

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 WatchPug

View all

197 more disclosed reports, best first.

More from Mochi 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.