20,000 USDC
View results
Submission Details
Severity: low

No minLoanSize check on the totalDebt in buyLoan function.

Summary

As the title suggests, the buyLoan function is missing a minLoanSize check on the totalDebt.

Vulnerability Details

Functions like giveLoan have the following check:

if (totalDebt < pool.minLoanSize) revert LoanTooSmall();

Basically, if the totalDebt is smaller than the minLoanSize, the transaction should revert. But, buyLoan function lacks this check. This means a lender will be able to buy a loan, whose debt is smaller than the pool's minimum size.
This is not consistent with other functions.

Impact

A lender is able to buy a loan that is smaller than their pool's minLoanSize.

Tools Used

Manual review

Recommendations

Please mention the following check in the buyLoan function:

if (totalDebt < pool.minLoanSize) revert LoanTooSmall();

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!