Skip to content
Business logic Audit finding Intermediate

LendingPair.liquidateAccount does not accrue and update cumulativeInterestRate

The liquidateAccount function fails to accrue and update the cumulative interest rate before liquidating, so the borrower's state is stale. An attacker could avoid paying interest by liquidating themselves instead of repaying when under-water.

cmichel Follow

Originally disclosed on Code4rena

Submitted by cmichel

The LendingPair.liquidateAccount function does not accrue and update the cumulativeInterestRate first, it only calls _accrueAccountInterest which does not update and instead uses the old cumulativeInterestRate.

The liquidatee (borrower)‘s state will not be up-to-date. I could skip some interest payments by liquidating myself instead of repaying if I’m under-water. As the market interest index is not accrued, the borrower does not need to pay any interest accrued from the time of the last accrual until now.

Recommend calling accrueAccount instead of _accrueAccountInterest

talegift (Wild Credit) confirmed but disagreed with severity:

Assets not at direct risk, but the function of the protocol or its availability could be impacted, or leak value with a hypothetical attack path with stated assumptions, but external requirements.

Update to severity - 2

ghoul-sol (Judge) commented:

No funds are lost however a user can steal “unpaid interest” from the protocol. Keeping high risk.

The original report as published on Code4rena, by cmichel. 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 liquidateAccount function calls _accrueAccountInterest instead of accrueAccount, so the global cumulativeInterestRate is not updated before liquidation.

Impact

A borrower could avoid paying interest accrued since the last update by liquidating themselves instead of repaying, leaking value from the protocol.

What the attacker needed

Borrower is under-water; borrower can liquidate themselves

The fix

The function should call accrueAccount instead of _accrueAccountInterest to update the cumulative interest rate before 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 a lending protocol, interest builds up over time and is tracked by a cumulative interest rate. When someone liquidates a borrower, the code should first update that rate to the current time. Here it does not, so the borrower's debt is calculated using an old rate, letting them pay less interest than they owe.

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 cmichel

View all

196 more disclosed reports, best first.

More from Wild Credit 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.