Liquidations can be frontrunned to avoid by paying as little as 1 share
The protocol's liquidation mechanism can be front-run by a borrower repaying a tiny amount (1 share) of debt, causing the subsequent liquidation call to revert with an overflow. This allows the borrower to avoid full liquidation.
LhoussainePh Follow with pseudoArtist and xiaoming90
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2025-06-notional-exponent-judging/issues/300
Found by
LhoussainePh, pseudoArtist, xiaoming90
Summary
The protocol integrates with Morpho which internally handeles the debt repayment in a way that when Liquidtions will be frontrunned via repayment with just 1 share it can easily be avoided. https://github.com/morpho-org/morpho-blue/blob/731e3f7ed97cf15f8fe00b86e4be5365eb3802ac/src/interfaces/IMorpho.sol#L247
Root Cause
The internal accounting method of Morpho leads to this bug.
Internal Pre-conditions
None
External Pre-conditions
None
Attack Path
During full liquidation the liquidator calls liquidate() which further calls _liquidate on MorphoLendingRouter:
function _liquidate(
address liquidator,
address vault,
address liquidateAccount,
uint256 sharesToLiquidate,
uint256 debtToRepay
) internal override returns (uint256 sharesToLiquidator) {
MarketParams memory m = marketParams(vault);
(sharesToLiquidator, /* */) = MORPHO.liquidate(
m, liquidateAccount, sharesToLiquidate, debtToRepay, abi.encode(m.loanToken, liquidator)
);
}
The above function simply calls the MORPHO.liquidate() with full sharesToLiquidate and debtToRepay, Now if we see the implementation of
Morpho.sol:
position[id][borrower].borrowShares -= repaidShares.toUint128();
market[id].totalBorrowShares -= repaidShares.toUint128();
The debtToRepay is repaidShares and when the liquidator tries to repay the full debt all of borrowedShares are reduced by repaidShares and the user is fully liquidated, however a user can simply call exitPosition to repay as little as 1 share to avoid liquidation , since when a user frontruns the liquidation call with 1 share to repay the debt , the Morpho.Liquidate call will panic revert with overflow when subtracting the repaidShares from the borrowShares and the liquidation will revert.
There is a warning on Morpho Interface as well for this bug and this can easily be avoided.
Impact
Panic revert with overflow will cause liquidations to fail.
PoC
No response
Mitigation
When a user calls exitPosition() it has a check _checkExit which should be updated to consider a logic for not letting user frequently exit
Consider making a variable lastExitTime and update it every time user exits just like it is done in enterPosition
Discussion
sherlock-admin2
The protocol team fixed this issue in the following PRs/commits: https://github.com/notional-finance/notional-v4/pull/14/files
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 integration with Morpho does not account for the borrower reducing their debt shares before liquidation, causing an underflow when the liquidator tries to repay the full original debt.
Impact
Liquidations can be made to fail, allowing borrowers to avoid liquidation.
What the attacker needed
Borrower has an open position; borrower can front-run liquidation
The fix
The protocol team fixed this issue in a pull request.
How it was found
- A liquidator initiates a full liquidation by calling liquidate().
- The borrower front-runs this by calling exitPosition() to repay 1 share of debt.
- The liquidator's transaction then calls Morpho.liquidate() with the original full debt amount.
- Morpho attempts to subtract the repaid shares from the borrower's reduced borrowShares, causing an overflow revert.
- The liquidation fails, and the borrower avoids being liquidated.
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.
When a borrower's debt becomes risky, a liquidator can repay it and take some collateral as a reward. Here, the borrower can quickly repay a very small part of the debt just before the liquidator acts, which makes the liquidator's transaction fail. This lets the borrower avoid being liquidated.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.