Skip to content
Business logic Audit finding Intermediate

dailyDebtIncreaseLimitLeft is not updated in liquidate()

The liquidate() function does not increase the daily debt increase limit counter, unlike repay(), so repaid amounts from liquidations cannot be borrowed again. On days with many large liquidations this leaves excess assets in the vault that cannot be borrowed, sharply lowering the utilisation rate.

lanrebayode77 Follow with Aymen0909 and 0xAlix2

Originally disclosed on Code4rena

Submitted by lanrebayode77, also found by Aymen0909 and 0xAlix2

On days with a significant number of liquidated positions, particularly when the asset quantity is substantial, there will be an excess of assets available in the vault that cannot be borrowed; thereby, causing a drastic decrease in the utilization rate.

This also contradicts what was stated in the repay() function, which asserts that repaid amounts should be borrowed again. Liquidation is also a form of repayment:

 // when amounts are repayed - they may be borrowed again
        dailyDebtIncreaseLimitLeft += assets;

Proof of Concept

dailyDebyIncreaseLimitLeft was not increamented in liquidate(), see here.

Recommended Mitigation Steps

Include dailyDebyIncreaseLimitLeft increment in liquidate().

dailyDebtIncreaseLimitLeft += state.liquidatorCost;

Assessed type

Context

kalinbas (Revert) confirmed

Revert mitigated:

Fixed here.

Status: Mitigation Confirmed. Full details in reports from thank_you, b0g0 and ktg.


The original report as published on Code4rena, by lanrebayode77. 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 liquidate() function was not updated to increment dailyDebtIncreaseLimitLeft when debt is repaid through liquidation, unlike repay().

Impact

On days with many substantial liquidations, excess assets remain in the vault that cannot be borrowed, causing a drastic decrease in the utilisation rate.

What the attacker needed

Many large liquidations in one day

The fix

The daily debt increase limit should be incremented inside liquidate() by the liquidator cost, and the project says it was fixed.

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 lending vault lets people borrow assets, but it caps how much new debt can be created each day. When someone repays, the code gives that room back so the assets can be borrowed again. Liquidations are also a form of repayment, but the code forgets to give the room back there, so after big liquidations the vault sits with assets nobody is allowed to borrow.

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 from Revert Lend

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.