The deposit() function in LendingPool lacks slippage protection, allowing an attacker to manipulate the liquidityIndex and reduce the amount of rToken minted for a user. This results in fewer reward tokens (raacToken) in the StabilityPool.
In LendingPool.deposit(), when a user deposits X amount of crvUSD, they receive rToken based on the liquidityIndex. However, this value can be front-run by a malicious actor who increases utilization by borrowing the present crvUSD, thereby increasing liquidityIndex and reducing the user's expected rToken amount.
Since liquidityIndex can be manipulated before execution, the final rTokenAmount is uncertain.
Assume liquidityIndex = 1e27 at the time of deposit.
A user deposits 100 crvUSD into LendingPool.deposit(), expecting:
A malicious actor front-runs the deposit by borrowing crvUSD, increasing liquidityIndex due to the formula:
If liquidityIndex increases to 1.1e27, the user now gets:
The user unknowingly receives fewer rToken, leading to a reduced amount of raacToken rewards in the StabilityPool.
Users receive fewer rToken than expected.
This results in lower deToken and raacToken rewards in StabilityPool.
The manipulation affects the fairness and predictability of the deposit process.
Manual Review
Implement slippage protection by requiring a minimum rToken output, either:
Specifying an expected rToken amount in BPS (basis points).
Allowing users to provide a minRTokenAmount parameter, reverting if not met:
This prevents deposits from being executed under manipulated conditions.
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.