The burn function in the Debt Token contract is documented to return a tuple with the following order:
Scaled tokens burned
New total supply after burning
Underlying tokens burned
Balance increase due to interest
However, the implementation returns the tuple as (underlying amount burned, total supply, scaled tokens burned, balance increase). This discrepancy causes the caller to misinterpret the values, resulting in incorrect debt accounting. As the protocol uses these values to update user balances and to adjust interest rates, the misinterpretation lead to significant errors in debt calculation enabling financial exploitation such as over- or under-burning of tokens, misrepresentation of user debt
Affected Code (Debt Token burn function):
DebtToken.sol#213
Caller Code Usage:
LendingPool.sol#416
Observation: The caller expects the first returned value (amountScaled) to be the normalized (scaled) amount, but it instead receives the underlying amount burned. Similarly, the third value (amountBurned) incorrectly receives the scaled amount.
Vulnerability Trigger:
This misalignment in return values will cause the protocol to update debt balances
incorrectly. Such errors in the debt accounting mechanism leads to discrepancies in user debt records
Manual Review
Align Return Values with Documentation:
Modify the burn function to return values in the correct documented order. For instance, change the return statement to:
This ensures that:
The first value is the scaled tokens burned.
The third value is the underlying tokens burned.
Update Documentation and Caller Logic (if needed):
Alternatively, if the implementation is intended to be as-is, update both the documentation and all callers to correctly interpret the returned values. However, the recommended approach is to fix the return order to match the intended design.
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.