bad debt is not accounted for during partial liquidation of an insolvent position
The protocol allows partial liquidation of an insolvent position, but does not account for the resulting bad debt. This leaves the loss to be borne by remaining protocol users.
Source: https://github.com/sherlock-audit/2025-05-lend-audit-contest-judging/issues/660
Found by
0xpetern, TessKimy, ifeco445, rudhra1749, theweb3mechanic
Summary
function liquidateBorrow(address borrower, uint256 repayAmount, address lTokenCollateral, address borrowedAsset)
external
{
// The lToken of the borrowed asset
address borrowedlToken = lendStorage.underlyingTolToken(borrowedAsset);
LTokenInterface(borrowedlToken).accrueInterest();
(uint256 borrowed, uint256 collateral) =
lendStorage.getHypotheticalAccountLiquidityCollateral(borrower, LToken(payable(borrowedlToken)), 0, 0);
liquidateBorrowInternal(
msg.sender, borrower, repayAmount, lTokenCollateral, payable(borrowedlToken), collateral, borrowed
);
}
protocol allows for partial liquidation, if a borrowers position is insolvent then a liquidator can liquidate him leaving bad debt to protocol.And there is no bad debt accounting mechanism in protocol, due to which protocol users should bare this bad debt loss
Root Cause
no mechanism to account for bad debt .
Internal Pre-conditions
none
External Pre-conditions
none
Attack Path
liquidator liquidates a undercollaterized insolvent borrow position due to which bad debt accures.
Impact
as there is no mechanism to account for bad debt of protocol this loss will be effected to remaining protocol users
PoC
No response
Mitigation
implement a mechanism for bad debt accounting
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 liquidation logic does not track or socialise bad debt when a position is partially liquidated and remains insolvent.
Impact
The bad debt from an insolvent liquidation is not accounted for, so the loss could be borne by remaining protocol users.
What the attacker needed
An insolvent borrow position exists; a liquidator performs partial liquidation
The fix
A mechanism for bad debt accounting should be implemented.
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, if a borrower's collateral is worth less than their debt, the position is insolvent. A liquidator can repay part of the debt and take collateral, but if the collateral is not enough to cover the debt, the remaining unpaid amount is 'bad debt'. This report says the protocol has no way to record or handle that bad debt, so other users effectively absorb the loss.
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.