The StabilityPool::liquidateBorrower
function incorrectly calculates scaledUserDebt
by multiplying the already scaled debt with the reserve usage index a second time. This results in an inflated debt value being used for liquidations, causing the stability pool to overpay for debt positions and potentially drain its reserves.
Relevant code snippet:
Test case to demonstrate vulnerability:
In StabilityPool.test.js
, add this test and run npx hardhat test --grep "overpays during liquidation due to double scaling"
High severity - Direct loss of protocol funds through inflated liquidation payments. The stability pool's crvUSD reserves will be drained faster than actual debt obligations require, potentially making the protocol insolvent.
Remove redundant debt scaling in liquidation logic:
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.