Incorrect Debt Scaling in Liquidation Leads to Failed Liquidations Despite Sufficient Funds
The liquidateBorrower
function in the StabilityPool
contract erroneously scales the user's debt twice, resulting in an inflated debt value. This causes the protocol to reject valid liquidations when it has sufficient funds to cover the actual debt.
Legitimate liquidations are blocked even if the protocol has sufficient crvUSD
balance. due to multiplication twice
Undercollateralized positions may remain uncleared, increasing systemic risk.
Setup:
User borrows 100 crvUSD
(actual debt after scaling = 100 * usageIndex).
StabilityPool
holds 150 crvUSD
.
Trigger Liquidation:
getUserDebt()
returns 100 * usageIndex
.
scaledUserDebt
becomes (100 * usageIndex) * usageIndex
(double scaling).
Check Fails:
Compare crvUSDBalance (150)
< scaledUserDebt (100 * usageIndex^2)
.
Reverts with InsufficientBalance
even though 150 > 100 * usageIndex
getUserDebt()
: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.