The liquidateBorrower
function in the StabilityPool contract contains a critical vulnerability that leads to direct loss of funds. By incorrectly scaling user debt twice, the function forces the Stability Pool to pay out significantly more crvUSD than required during liquidations. Each liquidation event results in excess crvUSD being withdrawn from the Stability Pool, effectively draining user deposits beyond the legitimate liquidation amounts.
In the liquidateBorrower
function, user debt is fetched from the lending pool.
The getUserDebt()
function already returns the normalized debt amount (including accrued interest).
However, the function then incorrectly multiplies this value again with getNormalizedDebt()
, to get scaledUserDebt
,resulting in double scaling of the debt amount.
HIGH
: Loss of funds from StabilityPool
Users will be liquidated for amounts larger than their actual debt
The Stability Pool will pay more crvUSD than necessary during liquidations
Protocol's accounting will be incorrect, leading to imbalances
Excess liquidations could lead to unnecessary losses for borrowers
The protocol's solvency calculations will be distorted
Manual review
Either Remove the additional scaling operation and use the userDebt value directly,
or set scaledUserDebt
to userDebt
as it is already scaled.
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.