A vulnerability exists in the LendingPool.sol
contract, specifically in the _withdrawFromVault()
function. When reserve tokens are withdrawn from the Curve Vault to address a liquidity shortfall, the withdrawn tokens are incorrectly kept in LendingPool.sol
rather than being transferred to RToken.sol
. This causes liquidity checks (e.g., during withdrawals or borrow operations) to incorrectly revert transactions due to perceived insufficient liquidity in RToken.sol
.
When a shortfall in the reserve buffer is detected, the following logic is triggered in _rebalanceLiquidity()
:
Similarly, sufficient liquidity is made sure available for withdrawals or borrowing via _ensureLiquidity()
:
When _withdrawFromVault()
function is triggered,
here's the problem:
The withdrawn reserve tokens are transferred to LendingPool.sol, address(this)
instead of RToken.sol
.
As a result, the RToken.sol
balance does not reflect the updated liquidity, causing operations that depend on available liquidity checks to fail unnecessarily.
Users calling withdraw()
will encounter DoS when RToken.burn()
is attempting to make the following transfer:
Users calling borrow()
will encounter DoS when attempting to make the following transfer:
Additionally, users calling deposit()
will have the withdrawn reserve assets tokens permanently stuck in Lending.sol
as _rebalanceLiquidity()
is also invoked at the end of its function logic.
Manual
Consider making the following refactoring:
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.