Interest generated by last bond will not go to anyone when liquidating as there is no bond amount to collect it
When the last remaining borrower is liquidated, the liquidation function withdraws the bond from the external protocol and updates the interest, but does not check whether any bond supply remains to receive that interest. The interest therefore becomes stuck with no one able to collect it.
Originally disclosed on Sherlock
Source: https://github.com/sherlock-audit/2024-11-autonomint-judging/issues/790
Found by
0x73696d616f
Summary
borrowingLiquidation::liquidationType1() withdraws the bond from the external protocol and updates the interest, but does not check if there is bond supply to distribute the interest to. Thus, if there are no bonds (if it was the only depositor being liquidated), it will be stuck.
Root Cause
In borrowingLiquidation:295, the bond is withdrawn from the external protocol without consideration for the supply of the bond or the number of borrowers.
Internal pre-conditions
None.
External pre-conditions
None.
Attack Path
- A single borrower exists that is liquidated, so the bond interest goes to nobody.
Impact
Stuck bond interest.
PoC
See links and explanation.
Mitigation
Check if the bond supply is non null and the number of borrowers.
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 routine withdraws the bond and updates interest without first checking that bond supply and borrower count are non-zero.
Impact
Bond interest becomes stuck and cannot be collected by anyone.
What the attacker needed
Only one borrower exists; that borrower is liquidated
The fix
The code should check that bond supply is non-null and that borrowers remain before withdrawing the bond and updating interest.
How it was found
- A single borrower exists and is liquidated, leaving no bond supply to receive the interest.
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 bond here is a deposit that earns interest, and the interest is shared among the people who hold bonds. When the only borrower is liquidated, the code still moves the bond and records interest, but there are no bond holders left to give it to. That interest is then stranded in the contract.
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.