# Liquidation repaidshares computation rounding issue

Morpho Blue liquidation rounds repaidShares down, so tiny liquidations repay zero debt while still seizing collateral, worsening borrower health and creating bad debt.

- Payout: Contest reward
- Severity: medium
- Program: Morpho Blue
- Credited: Christoph Michel
- Disclosed: 2024-09-28
- Write-up quality: 7/10
- Original: https://cdn.cantina.xyz/reports/cantina_competition_morpho_blue_dec2023.pdf#3.2.6
- Library page: https://bugbountylibrary.com/r/cantina%3Amorpho_blue_dec2023%3A3.2.6
- Tags: domain:web3 impact:funds-loss impact:integrity kind:contest platform:cantina sev:medium tech:evm tech:solidity technique:source-review vuln:business-logic vuln:liquidation vuln:precision-loss

**Target:** Lending protocol liquidation logic (Solidity smart contract)
**Root cause:** repaidShares is rounded down from seized-assets-converted repaid assets; when borrow share price > 1.0, repaidShares can round to 0 while seizedAssets is still taken from the borrower.
**Steps:**
1. Observe borrow share price (totalBorrowAssets/totalBorrowShares) can exceed 1.0 via high IRM rates or share price inflation.
2. Call liquidate with a tiny seizedAssets so repaidAssets converts to repaidShares = 0 after rounding down.
3. Liquidation seizes seizedAssets collateral but repays zero borrow shares, leaving debt unchanged.
4. Repeat splitting liquidations into tiny chunks to drain all collateral without reducing debt.
**How found:** Reviewer reasoned about rounding direction of repaidShares conversion and the possibility of share price > 1.0 from high IRM rates or share price inflation, noting repaidShares could round to zero while collateral is still seized.
**Exploitation:** Attacker repeatedly invokes liquidate with minimal seizedAssets amounts; each call rounds repaidShares to 0, seizing collateral while borrower debt stays constant, eventually fully liquidating collateral and leaving the protocol with the entire borrow debt as bad debt.
**Escalation:** Splitting into many tiny liquidations scales the drain across the whole position.
**Insight:** In share-based lending, check rounding direction of repaidShares vs seizedAssets when share price > 1.0; tiny-amount liquidations can round debt repayment to zero while collateral seizure still succeeds.
