There is no check when creating a pool on the minimum ratio between the debt of a borrower and their collateral. This enables a borrower to set a very low collateral when refinancing if the maxLoanRatio is not properly set.
When creating a lending pool by calling Lender.setPool() the only check for maxLoanRatio is if it zero. There should be a check whether it is for example lower than 8 * 10**17, so that the collateral is at least 1.25 the debt of the borrower, in order to secure lenders' money.
So a borrower can call Lender.refinance() and reduce their collateral a lot depending on the value of maxLoanRatio.
If maxLoanRatio is not properly set (e.g. 2*10**18) then a borrower can get half their collateral back which would not be very ideal for lenders, as it is shown in the test case below:
Manual review
Consider adding a check for a minimum value of maxLoanRatio when setPool() is called or e.g. when borrow()ing e.g.
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.