The LendingPool's borrow function uses a pre-calculated scaledAmount for user debt tracking while DebtToken mints a different amount that includes balance increase, creating a critical accounting mismatch in the protocol's debt tracking system.
the issue exist in the borrow function as follow :
while In DebtToken.mint():
Calculates initial scaled amount:
Calculates additional balance increase:
Returns:
While in LendingPool.borrow():
Updates user debt with pre-calculated amount:
So for example :
User borrows 100 tokens with index 1e27
LendingPool calculates scaledAmount = 100
User has previous balance with interest = 10
DebtToken mints 110 tokens (100 + 10)
LendingPool records only 100 as scaledDebtBalance
Interest Accrual:
Index increases to 1.1e27
Recorded debt shows 110 (100 * 1.1)
Actual debt is 121 (110 * 1.1)
11 token difference untracked
User's scaledDebtBalance is lower than actual minted tokens and this Gap increases with each interest accrual.
Update LendingPool's borrow function to use DebtToken's returned values.
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.