The LendingPool::_rebalanceLiquidity attempts to maintain the desired buffer ratio by depositing to or withdrawing from the CurveVault. The implementation has a critical problem in _depositIntoVault which gets triggered when there's excess liquidity. It gives approval to the CurveVault to transfer excess amount of tokens, but fails to account for the fact that all the reserveAsset tokens are held by RToken contract. Whenever liquidity providers deposit, LendingPool keeps none of it; all of it is transferred to RToken.
When the CurveVault is given approval, and it tries to transfer the excess amount, it would fail because LendingPool doesn't have any of the reserveAsset since excess amount of reserveAsset tokens weren't transferred to the LendingPool before triggering the CurveVault::deposit.
This results in DOS in following functions that make use of _rebalanceLiquidity,
deposit
withdraw
borrow
A DOS in core functions severely impacts the protocol's core functionality.
Manual Review
Transfer tokens first before calling CurveVault::deposit
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.