20,000 USDC
View results
Submission Details
Severity: high
Valid

No checking if loan's tokens are matched with pool's tokens in buyLoan() function.

Summary

No checking if loan's tokens are matched with pool's tokens in buyLoan() function.

Vulnerability Details

There is no checking if loan's loanToken and collateralToken are matched or not with pool's ones.
It will make Lender.sol contract confusing, as well as buyer or seller will be dangerous.

Impact

It will make Lender.sol contract confusing, as well as buyer or seller will be dangerous.

Tools Used

Manual

Recommendations

Need to check if loan's tokens are matched with pool's ones.

function buyLoan(uint256 loanId, bytes32 poolId) public {
// get the loan info
...
if (pools[poolId].loanToken != loan.loanToken)
revert TokenMismatch();
if (pools[poolId].collateralToken != loan.collateralToken)
revert TokenMismatch();
...

Support

FAQs

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