Should not add interest to loan debt when lender buys a loan.
In buyLoan(uint256 loanId, bytes32 poolId), interest is added to loan debt:
This leads to more interest to be accumulated on the loan in the future, as the interest is calculated based on the debt:
Imagine the following scenario, a borrower borrows 1000e18, interestRate is 5%, the borrower is expected to pay 50e18 in a year, however, if after 6 months, the accumulated interest is 25e18, the lender sells the loan, the loan debt becomes 1025e18 loan token, and borrower need to pay 25.625e18 in the next 6 months, that is 1050.625e18 in total.
Borrower will be required to pay more interest.
Manual Review
To fix this vulnerability, the accumulated interest should not be added to loan debt when lender buys a loan.
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.