Rounding flaw in Morpho Midnight lets attacker force liquidations
A researcher found a high-severity rounding vulnerability in Tenor Labs migration callbacks built on Morpho Midnight. Because mulDivDown rounds down, repaying 1 wei of debt transfers 0 collateral, pushing the borrower's target-market LTV to infinity and triggering liquidation of existing collateral.
- mulDivDown rounds down: 1000e18 * 1 / (1000e18 + 1) = 0
- Repaying 1 wei of debt transfers 0 collateral to the target market
- Target-market LTV hits infinity, triggering immediate liquidation
- Fix: revert when transfer is zero and repaidUnits > 0
Read next
Security