Skip to content
Business logic Audit finding Intermediate

Change in interest rate can disable repay of loan

The interest rate model owner can set an excessively high interest rate that causes the repay function to fail, preventing borrowers from repaying their loans. This could be exploited adversarially to force borrowers to pay more interest later.

pmerkleplant Follow

Originally disclosed on Code4rena

Submitted by pmerkleplant

Impact

The ability of a borrower to repay a loan is disabled if the interest rate is set too high by the InterestRateModel.

However, there is neither a check when setting the interest rate nor an indication in the IInterestRateModel’s specs of this behavior.

But this issue could also be used in an adversarial fashion by the FixedInterestRateModel-owner if he/she would disable the repay functionality for some time and enables it at a later point again with the demand of a higher interest to be paid by the borrower.

Proof of Concept

If an account wants to repay a loan, the function UToken::_repayBorrowFresh() is used. This function calls UToken::accrueInterest() (line 465) which fetches the current borrow rate of the interest rate model (line 546 and line 330).

The function UToken::borrowRatePerBlock() requires an not “absurdly high” rate, or fails otherwise (line 331).

However, there is no check or indicator in FixedInterestRateModel.sol to prevent the owner to set such a high rate that effectively disables repay of borrowed funds (line 36).

Recommended Mitigation Steps

Disallow setting the interest rate too high with a check in FixedInterestRateModel::setInterestRate().

kingjacob (Union) confirmed

GalloDaSballo (judge) commented:

Agree with the need for a check on the setInterestRate function Since the warden showed a specific way to negate certain protocol functionality, under specific assumptions, the finding is of medium severity

The original report as published on Code4rena, by pmerkleplant. 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 FixedInterestRateModel contract lacks a check to prevent setting an interest rate so high that it causes the repay function to revert.

Impact

Borrowers may be unable to repay their loans, and a malicious owner could temporarily disable repayments to later demand higher interest.

What the attacker needed

Owner of FixedInterestRateModel; borrower has an outstanding loan

The fix

The fix is to add a check in FixedInterestRateModel::setInterestRate() to disallow setting the interest rate too high.

How it was found

  1. The owner sets an excessively high interest rate in FixedInterestRateModel.
  2. A borrower attempts to repay a loan via UToken::_repayBorrowFresh().
  3. The function calls accrueInterest(), which fetches the current borrow rate.
  4. The borrow rate is too high, causing borrowRatePerBlock() to fail.
  5. The repay transaction reverts, so the borrower cannot repay.

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 system, borrowers must repay their loans with interest. If the interest rate is set extremely high, the code that calculates the repayment amount may fail, so the borrower cannot repay at all. The owner of the interest rate contract could abuse this to block repayments and later demand more interest.

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 pmerkleplant

View all

2 more disclosed reports, best first.

More from Union Finance 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.