The DebtToken::mint function incorrectly includes accrued interest (balanceIncrease) in new debt token mints, creating a compounding error where interest is calculated on already-accrued interest. This occurs because:
balanceOf() returns actual debt (scaled balance × current index)
scaledBalance in mint operation uses this inflated value
Subsequent interest calculations compound on the already interest-adjusted balance (e.g functions that update reverse interests before minting debt tokens like LendingPool::borrow)
Initial Borrow
User borrows 100 tokens @ 1.0 RAY index
Actual debt: 100 × 1.0 = 100
Raw scaled balance: 100 (stored)
Interest Accrual
Index increases to 1.1 RAY
Existing debt updates to: 100 × 1.1 = 110
Second Borrow
User borrows another 100 tokens @ 1.1 RAY index
New debt: 110 + 111 = 221
Test case to demonstrate vulnerability:
In DebtToken.test.js, add this test and run npx hardhat test --grep "mints debt with compounded interest error"
Critical Severity
Debt balances grow 5.2% faster than intended in this scenario (221 vs 210)
Compounding effect worsens with repeated borrows/rate changes
Protocol accounting becomes unreliable, risking insolvency
Option 1: Use raw scaled balances for interest calculation
Option 2: Omit inclusion of balanceIncrease
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.