Skip to content
Business logic Audit finding Intermediate

Health ratio is hardcoded causing issues once the LTV is updated

The health ratio used to determine when a borrower can be liquidated is hardcoded to 80% in several places, but the protocol's loan-to-value (LTV) ratio is intended to increase over time. If the LTV is raised to 90%, borrowers would only become liquidatable after a 20% collateral drop instead of 10%, allowing insolvent positions to persist and accrue bad debt.

John44 Follow

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2024-11-autonomint-judging/issues/1031

Found by

John44

Summary

The current LTV of the protocol is 80% and is intended to increase as much as possible once the protocol matures (as stated in the docs). The issue is that the health ratio of borrow positions is hardcoded in several places causing issues once the LTV is actually updated.

Root Cause

In BorrowLib and in borrowLiquidation the health ratio of a position is hardcoded to 8000 = 80%. This is because the initial LTV of a deposit will be 80%. The health ratio is used to make sure that a withdrawer cannot withdraw their collateral if they are eligible for liquidation and more importantly to determine whether a borrower can be liquidated. The issue is that the LTV is intended to grow, therefore if the LTV grows for example to 90%, a hardcoded health ratio of only 80% will be insufficient.

https://github.com/sherlock-audit/2024-11-autonomint/blob/0d324e04d4c0ca306e1ae4d4c65f0cb9d681751b/Blockchain/Blockchian/contracts/lib/BorrowLib.sol#L501 https://github.com/sherlock-audit/2024-11-autonomint/blob/0d324e04d4c0ca306e1ae4d4c65f0cb9d681751b/Blockchain/Blockchian/contracts/lib/BorrowLib.sol#L822 https://github.com/sherlock-audit/2024-11-autonomint/blob/0d324e04d4c0ca306e1ae4d4c65f0cb9d681751b/Blockchain/Blockchian/contracts/Core_logic/borrowLiquidation.sol#L191 https://github.com/sherlock-audit/2024-11-autonomint/blob/0d324e04d4c0ca306e1ae4d4c65f0cb9d681751b/Blockchain/Blockchian/contracts/Core_logic/borrowLiquidation.sol#L336

Internal pre-conditions

No response

External pre-conditions

No response

Attack Path

  1. After some time the LTV is increased to 90%, thus the debt of borrowers will be worth 90% of their collateral.
  2. However, as the health ratio is hardcoded to 80%, the only way for a borrower to be liquidated is if their collateral decreases it's value by 20%, instead of 10%.
  3. Therefore, debt positions will always be heavily insolvent before they can be liquidated, increasing the risks of bad debt accruing to the protocol.

Impact

Once the LTV is increased, the health ratio will remain the same, causing debt positions to not be liquidatable even when they are insolvent, accruing bad debt to the protocol.

PoC

No response

Mitigation

The health ratio should be modifiable in order to account for the increasing LTV.

The original report as published on Sherlock, by John44. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

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

Impact

Once the LTV is increased, positions that are insolvent may not be liquidatable, causing bad debt to accrue to the protocol.

What the attacker needed

LTV is increased above 80%

The fix

The health ratio should be made modifiable so it can be updated to match changes in the LTV.

How it was found

  1. The LTV is increased to 90%, so borrowers can owe 90% of their collateral value.
  2. Because the health ratio remains hardcoded at 80%, a borrower is only liquidatable after collateral value drops by 20%, not 10%.
  3. Debt positions become heavily insolvent before liquidation can occur, increasing bad debt risk.

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 health ratio is a number that tells the protocol whether a borrower's debt is still safely covered by their collateral. Here it is fixed at 80%, but the protocol plans to let people borrow a higher percentage of their collateral later. If that happens, the fixed number will be too low, so borrowers will not be liquidated when they should be, and the protocol may lose money.

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 John44

View all

2 more disclosed reports, best first.

More from Autonomint Colored Dollar V1

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.