The LendingPool::_withdrawFromVault incorrectly calls the curveVault with owner of shares as msg.sender, which would revert a legitimate LendingPool::withdraw, LendingPool::deposit or LendingPool::borrow transaction.
The LendingPool::_withdrawFromVault function is being used inside the LendingPool::_ensureLiquidity and LendingPool::_rebalanceLiquidity to maintain the enough liquidity in the LendingPool contract.
However, the _withdrawFromVault has a critical parameter of owner, which is currently being passed as msg.sender instead of address(this). The depositor of the crvUSD is the contract itself which can be verified inside the _depositIntoVault function:
But in the case of _withdrawFromVault:
Which implies that the user should be fulfilling the withdraw instead of the LendingPool contract.
The LendingPool::_rebalanceLiquidity and LendingPool::_ensureLiquidity would revert in case of deficit being withdrawn, which breaks the LendingPool::withdraw, LendingPool::deposit and LendingPool::borrow functions, rendering the contract useless.
The funds stuck cannot be withdrawn under any circumstance as the LendingPool contact in itself is non-upgradable.
Loss of funds for users who might coincidently have deposited crvUSD in the vault on a individual level.
Manual Review
It is recommended to replace msg.sender with address(this) in place of the owner parameter:
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.