The incorrect debt calculation in StabilityPool.sol will prevent legitimate liquidations by owners/managers as the returned debt amount does not account for elapsed time interest accrual.
In StabilityPool.sol and LendingPool.sol, the getUserDebt() function fails to account for interest accrued over elapsed time when calculating user debt, while finalizeLiquidation() does update the reserve state with current interest.
Time needs to elapse since reserve.lastUpdateTimestamp
User needs to have debt in the lending pool
Owner/manager needs to attempt liquidation through StabilityPool.sol#liquidateBorrower()
Owner/manager calls liquidateBorrower() with a user's address
Function fetches debt via getUserDebt() which returns stale debt value
finalizeLiquidation() updates reserve state with current interest
Transaction reverts due to insufficient balance check since actual debt is higher than fetched amount
The protocol owners/managers cannot execute legitimate liquidations through the StabilityPool, potentially leading to increased bad debt accumulation.
Modify LendingPool.sol#getUserDebt() to calculate and return the current debt including accrued interest based on elapsed time since last update.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.