The loan lender field can be changhed by an attacker when buiyng the loan due to the missing validation.
In the buyLoan function the loans[loanId].lender is set to msg.sender, howerer, it is not checked if the msg.sender is the new pool (poolId) lender.
This will allow an attacker to pass any poolId and become the loan lender, which will allow an attacker to start the auction, seize the loan and get collaterals, give the loan to another pool, and in case of loan repayment an attacker will be allowed to withdraw them.
Manual Review
Verify if msg.sender is the new pool lender in the buyLoan.
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.