20,000 USDC
View results
Submission Details
Severity: high

Unchecked transfer return value in `borrow()` and in `repay()` lead to potential loss of funds.

Summary

In both the borrow() and repay() functions in the Lender.sol contract, the return values of transfer and transferFrom are unchecked.

Vulnerability Details

When a borrower goes to borrow, the transfer may return false but their debt owed has been set, so they will have posted collateral and owe money on a loan in which they did not receive any tokens.

Similarly in the repay() function, a borrower can repay a loan, but since the transfer goes unchecked, the may have paid off their loan, but may not receive their collateral back

Impact

Borrower can lose all their funds.

Tools Used

manual review and vs code

Recommendations

Check return values on transfer and transferFrom to make sure they are working properly.

Support

FAQs

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