A critical error in the RToken.mint
interest accrual logic allows permanent loss of user-earned interest. The vulnerability manifests when users make multiple deposits, as the implementation fails to compound existing balances' accrued interest into new mint operations. This breaks the fundamental promise of interest-bearing tokens by systematically undercounting balances, leading to irreversible fund loss proportional to deposit frequency and interest rate levels.
The vulnerability exists in the interest accrual logic of the RToken.mint
function at RToken.sol#L129-L136. When users make subsequent deposits after initial minting, the protocol fails to properly compound accrued interest from their existing balance into the new mint operation.
The flawed implementation calculates a balanceIncrease
representing accrued interest between index updates but neglects to add this amount to the newly minted tokens. This results in the interest being permanently excluded from the user's balance and the protocol's accounting system.
The core issue stems from:
Interest calculation being performed but not incorporated into the minting amount
Scaled balance updates not accounting for accrued interest between user interactions
The _update
function's scaling logic being applied to raw amounts without considering pending interest
This breaks the fundamental interest-bearing token mechanic where existing balances should automatically accrue interest that compounds with new deposits. The error causes systematic under-accounting of user balances during subsequent interactions with the lending pool.
This vulnerability directly causes permanent loss of user funds through failed interest compounding. For example:
Initial Deposit: User deposits 100 RToken when liquidity index = 1.0
Interest Accrual: Index rises to 1.1 (10% interest)
Second Deposit: User deposits another 100 RToken
Expected Balance: (100×1.1) + 100 = 210 RToken
Actual Balance: 200 RToken (10 RToken lost)
Subsequent Deposit: Index rises to 1.21, user deposits 100 RToken
Expected Balance: 210×1.1 + 100 = 331 RToken
Actual Balance: 300 RToken (31 RToken total loss)
This creates a compounding loss mechanism where each deposit permanently discards all previously accrued interest. Long-term users making regular deposits could lose >30% of expected returns. The protocol's core value proposition of interest-bearing tokens becomes fundamentally broken, leading to systemic underpayment of all depositors and potential protocol insolvency claims.
Manual Review
Implement the following changes to ensure proper interest compounding:
Core Fix - Add accrued interest to mint amount:
Validation - Add boundary checks:
This ensures the interest-bearing token implementation aligns with industry standards like Aave's aToken model where interest automatically compounds to existing balances.
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.