Borrowers will incure more debt tokens when at a point their borrower index is less than the reserve usage index.
When borrowers take loan from the LendingPool contract, users receive debt token proportional to the loan they take. Borrowers who take loan when their usage index is less than the reserve usage index, interest is calculated and adds accrued debt to the amount of reserveasset being taken. Observe the mint
function:
The mint function ensures to update amountToMint with the accured debt (balanceIncrease). This is not considered when borrowers repay their loan in the burn function.
The burn
function fails to properly account for the accrued interest (balanceIncrease
) before burning the repayment amount. While the mint
function correctly adds accrued debt, the burn
function merely computes it but does not adjust the repayment amount accordingly. This can lead to incorrect debt reductions, allowing users to repay less than they actually owe.
However, another issue could arise from this where borrowers face forced liquidation due to the flaw in the burn function.
POC:
This POC confirms interest bypass when users repay debt tokens (mint/burn).
https://gist.github.com/Ephraim-nonso/070b2b7d779e5cf867b3c2ef308288ad
Debt underpayment exploit
Borrowers can be forced liquidated due to remaining debt tokens after a partial repay
Manual review and Foundry.
Consider accured interest and add to amount when users repay their debts. This is to avoid underpayment and possibility of forcibly liquidating borrowers.
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.