The burn
function updates the user's interest index to the parameter index
instead of the current borrow index. If index
is outdated, this allows the user to accrue interest incorrectly in subsequent interactions.
When burning debt tokens (repaying debt), the contract updates the user's stored interest index to the index
parameter passed into the function instead of the current borrow index. This creates a mismatch between the user's index and the protocol's actual state, leading to incorrect interest accrual in future interactions.
The borrow index (_usageIndex
) tracks cumulative interest. For example:
Index starts at 1.0e27
(RAY).
After interest accrues, it increases to 1.1e27
.
A user’s debt grows proportionally to the index increase since their last interaction.
When a user repays debt:
Accrue interest up to the current index.
Update the user’s index to the current index.
Reduce their debt based on the updated balance.
The function burn uses the parameter index
(which is incorrcet) to update the user’s index. if index
is stale, the user’s index won’t reflect the latest interest accrual.
Example:
Current borrow index: 1.2e27
.
User’s debt: 100
units (scaled balance: 100 / 1.2 ≈ 83.33
).
User’s stored index: 1.1e27
(from a previous interaction).
The borrow index increases to 1.3e27
.
The burn
function is called with index = 1.2e27
(outdated).
The user’s index is updated to 1.2e27
instead of the current 1.3e27
.
Next time the user interacts, their debt is calculated as:
If the index later rises to 1.4e27
But it should be:
The user’s debt is overstated by **~7.48 tokens **because their index was not updated to the latest value during burning.
A malicious actor could front-run transactions to manipulate the index
parameter, freezing users’ indices at advantageous values. Users will be charged interest for periods when they had already repaid debt, leading to unfair overpayment.
Foundry
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.