The LendingPool::borrow
function allows a user to borrow more than the liquidation threshold health factor
, as it lacks additional validations for the borrowers health factor after they get their desired amount, leaving them vulnerable to liquidation right after borrow, in certain cases.
The LendingPool::borrow
function allows a user to borrow an amount, that would make them available for a liquidator to initiate a liquidation on the borrower, right after the borrow completes. This can put users funds at risk, without the user realizing it, as they expect to be safe from liquidation right after a borrow, in case there are no drops in their collateral value, which is not true in the code.
Impact: High, as it makes the borrower available for initiating liquidation on him right after a successful borrow
Likelihood: Medium, as not every borrow will make the borrower go over the health factor limit
Add a test similar to the one below inside here :
Tools Used
Manual Review
Add an additional check inside the LendingPool::borrow
function, that validates the user health factor will still be above the liquidation threshold after borrowing, by adding something like the following:
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.