The burn function incorrectly calculates debt repayment by using an outdated _userState[from].index before updating it to the latest index. This results in an incorrect computation of balanceIncrease, which represents the accrued interest. The function fetches borrowIndex from ILendingPool(_reservePool).getNormalizedDebt() after performing calculations based on the outdated index, creating a discrepancy between expected and actual debt repayments. To add, amountScaled = amount.rayDiv(index); incorrectly reduces the repayment amount due to improper scaling, potentially causing debt underpayment. The incorrect execution flow is evident in the following code snippet:
Since amountScaled is calculated before properly updating _userState[from].index, it may be smaller than the actual debt owed, allowing borrowers to repay less than they should. This results in accumulated unpaid interest, leading to a discrepancy between recorded and actual debt.
Borrowers can underpay their debt, leading to an increasing gap between total outstanding debt and actual repayments, which over time causes protocol insolvency as unpaid interest accumulates.
Update _userState[from].index before computing balanceIncrease, fetch borrowIndex first, and use borrowIndex instead of index when calculating amountScaled.
Interest IS applied through the balanceOf() mechanism. The separate balanceIncrease calculation is redundant/wrong. Users pay full debt including interest via userBalance capping.
Interest IS applied through the balanceOf() mechanism. The separate balanceIncrease calculation is redundant/wrong. Users pay full debt including interest via userBalance capping.
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.