The liquidateBorrower function in the StabilityPool contract calls lendingPool.getUserDebt to retrieve the user's debt, which already includes the multiplication by reserve.usageIndex. However, the liquidateBorrower function then incorrectly multiplies the debt again by reserve.usageIndex (via lendingPool.getNormalizedDebt()), leading to a double multiplication of the debt by the same factor. This results in an incorrect and inflated debt value being used in the liquidation process.
The getUserDebt function already multiplies the user's scaled debt balance (user.scaledDebtBalance) by reserve.usageIndex to calculate the user's debt:
The liquidateBorrower function incorrectly multiplies the debt again by reserve.usageIndex (via lendingPool.getNormalizedDebt()):
The debt is effectively multiplied twice by reserve.usageIndex, leading to an inflated and incorrect debt value.
The double multiplication results in a debt value that is much larger than the actual debt, so the allowance to be approved is larger than expected. The impact is Low, the likelihood is High, so the severity is Medium.
Manual Review
Remove the unnecessary multiplication in liquidateBorrower:
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.