The StabilityPool::liquidateBorrower() function incorrectly multiplies the user's debt by the normalized debt index twice, resulting in liquidations that are much larger than they should be.
In StabilityPool::liquidateBorrower(), the user's debt is fetched from the lending pool and then incorrectly multiplied again by the normalized debt:
The issue is that LendingPool::getUserDebt() already returns the debt normalized by the usage index. By multiplying again by getNormalizedDebt(), the function is effectively squaring the normalization factor.
Assume a user has borrowed 100 tokens and the normalized debt index is 1.1
LendingPool::getUserDebt() returns 110 (100 * 1.1)
StabilityPool::liquidateBorrower multiplies 110 by 1.1 again
Final liquidation amount is 121 tokens (110 * 1.1) instead of the correct 110 tokens
This causes liquidations to be executed for amounts significantly higher than the actual user debt. The excess liquidation amount could prevent legitimate liquidations if the stability pool has insufficient balance due to inflated liquidation amounts
Remove redundant normalization
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.