20,000 USDC
View results
Submission Details
Severity: high

Borrower can repay his loan without paying the loan tokens back.

Summary

Borrower might repay his loan without even transferring the loan tokens because of the property of some special erc20 tokens

Vulnerability Details

Some erc20 tokens doesn't revert when the transfer of tokens fails instead they return false and this contract doesn't check for the returned value of transfer and transferFrom function whether it is true or not due to which transfer of tokens might have failed but the repay function will continue till the end and delete the loan from the loans array and it will appear as if the borrower paid its loan but in reality it didn't and get his collateral back.

Impact

This can cause the pools to be in debt without even realizing and ultimately the lender.sol contract might not have enough loan tokens to give more loans and might become insolvent.

Tools Used

Manual Review

Recommendations

Add checks to see if the transfer of tokens were successful or not

Support

FAQs

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