Arbitrary user who is not lender of pool can become the lender of loan, and lock loan’s collateral forever.
At the end of the buyLoan() function, it updates the loans[loanId].lender
to msg.sender
. However, the function does not check if pool owner equals to msg.sender, Anyone can update themselves to loan[loanId].lender
.
If the loan[loanId].lender
does not equals to pool lender, the getPoolId()
will return different pool address than its actual pool Id. Most of the function will revert and it will lock all the funds of loan.
test code: modified from Lender.t.sol
This code should revert, but it works even if the function called with random address.
Locking all the collateral using buyLoan function.
vs code
add this line of code to 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.