Skip to content
Business logic Audit finding Intermediate

Lack of minimum debt threshold enables unliquidatable small positions

The lending router lets a borrower repay almost all of a position, leaving a tiny debt such as one wei, and it sets no minimum debt size. Because liquidation rewards scale with the repaid amount while gas costs are fixed, liquidators have no incentive to clear these positions, so they can pile up and distort the protocol's solvency assumptions.

0xKemah Follow with 0xenzo, Audinarey and 8 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-06-notional-exponent-judging/issues/684

This issue has been acknowledged by the team but won't be fixed at this time.

Found by

0xKemah, 0xenzo, Audinarey, EddiePumpin, LhoussainePh, Pro_King, SOPROBRO, jasonxiale, molaratai, oxwhite, theweb3mechanic

Summary

The protocol allows users to repay debt partially through the exitPosition() function, even if a minimal amount of debt remains (e.g., 1 wei). Since liquidation incentives are proportional to the repaid debt and gas costs are fixed, such positions offer no economic incentive for liquidators. As a result, these small debt positions accumulate over time, becoming unliquidatable and potentially leading to long-term protocol insolvency.

Root Cause

When users open a position without providing upfront collateral by calling enterPosition() with a non-zero borrowAmount and a depositAssetAmount of zero. The protocol takes a flashloan from Morpho for the borrow amount, mints shares with it, supplies those shares as collateral to Morpho, and then borrows the same amount to repay the flashloan resulting in a position where collateral equals the borrowed amount. If a deposit is provided, the collateral becomes greater than the debt. So collateral can be >= borrowAmmount . This logic enables fully collateralized positions with little or no initial user capital.

JavaScript
//AbstractLendingRouter.sol

L56:  function enterPosition(
        address onBehalf,
        address vault,
        uint256 depositAssetAmount,
        uint256 borrowAmount,
        bytes calldata depositData
    ) public override isAuthorized(onBehalf, vault) {
        _enterPosition(onBehalf, vault, depositAssetAmount, borrowAmount, depositData, address(0));
    }

L79:   function _enterPosition(
        address onBehalf,
        address vault,
        uint256 depositAssetAmount,
        uint256 borrowAmount,
        bytes memory depositData,
        address migrateFrom
    ) internal {
       ...
@>        if (depositAssetAmount > 0) {
            // Take any margin deposit from the sender initially
            ERC20(asset).safeTransferFrom(msg.sender, address(this), depositAssetAmount);
        }

  @>      if (borrowAmount > 0) {
            _flashBorrowAndEnter(
                onBehalf, vault, asset, depositAssetAmount, borrowAmount, depositData, migrateFrom
            );
        } else {
            _enterOrMigrate(onBehalf, vault, asset, depositAssetAmount, depositData, migrateFrom);
...

When repaying through exitPosition(),

JavaScript
//AbstractLendingRouter.sol

    function exitPosition(
        address onBehalf,
        address vault,
        address receiver,
        uint256 sharesToRedeem,
        uint256 assetToRepay,
        bytes calldata redeemData
    ) external override isAuthorized(onBehalf, vault) {
        _checkExit(onBehalf, vault);

        address asset = IYieldStrategy(vault).asset();
        if (0 < assetToRepay) {
L120:            _exitWithRepay(onBehalf, vault, asset, receiver, sharesToRedeem, assetToRepay, redeemData);
        } else {
...
}

a borrower can make partial repayments that reduce their debt to extremely small amounts, such as 1 wei. These minimal debt positions offer no meaningful incentive for liquidators, who must cover fixed gas costs to execute liquidation but receive rewards that are too small especially on Ethereum mainnet which is the only chain the contract will be deployed to.

Internal Pre-conditions

  • Borrower must borrow small amounts such as 1 wei.
  • Or reduce his debt positions to 1 wei

External Pre-conditions

none

Attack Path

none

Impact

  • Positions with tiny debt amounts remain permanently unliquidated.

  • Over time, these accumulate and skew the protocol’s debt accounting and solvency assumptions.

PoC

No response

Mitigation

  • Enforce a minimum borrow size
  • Or prevent users from leaving behind trivial debt after repay or withdrawal.

Discussion

T-Woodward

Unliquidatable small positions are the underlying lending protocol's problem, not ours. They affect the lending protocol's users (the lenders), not ours (the borrowers).

Guarding against these scenarios is their job, not ours.

The original report as published on Sherlock, by 0xKemah. 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

Root cause

Likely the router enforces no minimum borrow or residual debt, so partial repayment can leave a position too small to be worth liquidating.

Impact

Tiny debts may stay unliquidated indefinitely and, as they accumulate, could skew the protocol's debt accounting and solvency assumptions; the team argues these positions are the underlying lending protocol's problem rather than the router's.

What the attacker needed

Borrow a tiny amount or repay down to dust; deployment on Ethereum mainnet

The fix

The report suggests enforcing a minimum borrow size or preventing users from leaving trivial debt after repayment or withdrawal, though the team has acknowledged the issue and declined to fix it for now.

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, a liquidator is someone who repays a risky borrower's debt in exchange for a reward. Here a borrower can leave behind a debt so small that the reward is worth less than the cost of the transaction, so nobody bothers to clear it. The report argues these dust-sized debts can build up and make the protocol's books look healthier than they are.

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 0xKemah

View all

1 more disclosed report, best first.

More from Notional Exponent

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.