The liquidateBorrower
function in the StabilityPool contract incorrectly scales the user's debt by multiplying it with the usage index, even though the getUserDebt
function already returns the scaled debt. This results in the scaledUserDebt
being higher than it should be, causing liquidations to fail even when the StabilityPool has sufficient funds to cover the actual user debt. This flaw prevents the protocol from liquidating undercollateralized positions, increasing the risk of bad debt.
The liquidateBorrower
function retrieves the user's debt using getUserDebt. and multiplies it with usage index again. This results in the scaledUserDebt
being double-scaled, as userDebt
is already scaled by the usage index
. If StabilityPool has only funds enough to cover user real dept not increased dept, liquidateBorrower would fail.
Liquidations may fail even when the StabilityPool has sufficient funds to cover the actual user debt.
Manual
The liquidateBorrower
function should not scale the debt again, as getUserDebt
already returns the scaled debt.
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.