User can buy a loan with pool which is not owned by him.
function buyLoan must to be called with loanId and poolId without check if poolId is owned by msg.sender. As result is transfered loan to user pool which is payed by other user pool.
In function buyLoan missing check if(pools[poolId].lender == msg.sender)
For example:
Alice create pool with 50 DAI
Bob get a loan from Alice pool for 30 DAI
Bob not pay his loan and Alice start auction
Nobody buy a loan on auction
Attacker call buyLoan function with bob loanId and Alice poolId
Attacker is now owner of bob loan which is pay by Alice pool
User can lose funds due to somebody buy loan with they pool funds
Manual Review
Add check in buyLoan
if (pools[poolId].lender != msg.sender) revert Unauthorized();
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.