Interest generated by last bond will not go to anyone when liquidating as there is no bond amount to collect it
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.