There is no check whether someone is the pool lender before buying a loan, so anyone can just buy loans for others and mess up the protocol or a borrower can just keep buying their loan in the expense of others and extend it indefinitely.
The Lender.buyLoan()
function is vulnerable to the aforementioned scenario, since there is no check whether the loan buyer is the owner of the pool. So anyone can manipulate the pool by buying loans for others or just keep buying their loan with other people's tokens.
The zapBuyLoan()
is not vulnerable since a pool is created before buying the loan with lender
as the msg.sender
, so there is no incentive in this function.
Add the following test to Lender.t.sol
:
Foundry, manual review
Add the following check to the buyLoan()
function:
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.