Depositing in LendingPool does not take into consideration the liquidity index and mints rToken at a 1:1 ratio, which then can be redeemed continuously until the pool is drained
The protocol uses liquidity index to track interest accrual in the lending pool, identical to how Curve finance does it. It works the following way:
User provides 100 USDC at index = 2 and receives 100/2 = 50 rUSDC
At index = 3 user has accrued 50% in interest and decides to withdraw
Withdrawal amount = rTokens * index = 50 * 3 = 150 USDC
However, it is implemented incorrectly here due to the user being minted rTokens at a constant 1:1 ratio.
From the snippet above we see that if a user deposits 100 USDC they will always receive 100 rUSDC, regardless of the index.
Malicious actors can abuse this and perform deposit-withdraw attacks.
Deposit 100 USDC at index 2, receive 100 rUSDC
Withdraw 100 rUSDC at index 2, receive 200 USDC
Repeat steps 1 and 2
Protocol is drained
Pass amountScaled in _mint instead of amountToMint
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.