The vulnerability resides in the DebtToken's transferability (Lines not explicitly restricted in DebtToken.sol), allowing attackers to separate debt ownership from protocol accounting. By transferring DebtTokens, malicious actors can manipulate debt repayments, leading to protocol insolvency and corrupted user debt tracking.
The LendingPool contract tracks user debt via the scaledDebtBalance variable but calculates repayable amounts using the ERC20 balanceOf method of the DebtToken. If the DebtToken is transferable (default ERC20 behavior), attackers can:
Transfer DebtTokens to other addresses.
Exploit the fragmented debt ownership to repay inflated balances.
Cause underflows in scaledDebtBalance or drain reserves via over-repayment.
DebtToken Transfer Function (assuming standard ERC20):
Repayment Logic in LendingPool (Lines 312-335):
Protocol Insolvency: Attackers repay debts using transferred tokens, draining reserves without collateral.
Debt Tracking Corruption: Underflows in scaledDebtBalance disrupt interest calculations.
Free Debt Arbitrage: Malicious users "sell" debt tokens to unwitting parties, profiting from protocol flaws.
Manual Code Review: Identified reliance on transferable DebtToken balances.
Hardhat: Simulated token transfers and repayment inconsistencies.
Slither: Detected unsafe ERC20 balance usage in critical logic.
An attacker transfers DebtTokens to a victim, tricking the protocol into accepting over-repayments that corrupt debt tracking.
Attacker: Transfers debt tokens to exploit repayment logic.
Victim: Repays inflated debt using transferred tokens.
Protocol: Incorrectly reduces debt balances, enabling reserve theft.
Disable DebtToken Transfers:
Override ERC20 transfer functions in DebtToken:
Use Internal Debt Tracking:
Replace balanceOf with the stored scaledDebtBalance in repayment logic:
Validate Debt Ownership:
Add a modifier to ensure only the debt owner can repay:
Transferable DebtTokens decouple ERC20 balances from protocol debt tracking, enabling reserve drainage and state corruption. Immediate mitigation requires disabling transfers and revising repayment logic to use internal debt records.
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.