In DebtToken::mint, if the user is not minting DebtTokens for the first time, the condition if (_userState[onBehalfOf].index != 0 && _userState[onBehalfOf].index < index) will be triggered to calculate the balance increase caused by interest accumulation. balanceIncrease will no longer be equal to 0.
However, since the condition is not strictly enforced, users can manipulate the index value and choose a lower index that makes the condition fail, thus avoiding the calculation of balanceIncrease.
Note:
The RToken::mint function has a similar issue!
Suggested fix: if (_userState[onBehalfOf].index == index) revert InvalidAmount();
The DebtToken::burn function also has a similar issue!
Suggested fix: if (_userState[from].index == index) revert InvalidAmount();
Interest Evasion: Users can selectively pass in a lower index value to make the condition fail and avoid paying the balanceIncrease caused by interest accumulation. This allows users to repeatedly mint debt tokens at a lower cost.
Ensure that the index passed into the mint function is reasonable and cannot be lower than the previous index!
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.