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

Missing Array Length Check in GiveLoan Function

Summary

A vulnerability has been identified in the giveLoan function where there is a missing check for the length of array arguments. The function accepts two array arguments, loanIds and poolIds, without verifying if their lengths match. This oversight can lead to unintended behaviors.

Vulnerability Details

The giveLoan function is designed to allow a lender to transfer multiple loans to different pools. It takes in two array arguments: loanIds, which contains the IDs of the loans to be transferred, and poolIds, which contains the IDs of the pools to which the loans should be transferred.

However, there's no check to ensure that the lengths of these two arrays match. This means that a user could potentially provide mismatched arrays, leading to loans being transferred to unintended pools or not being transferred at all.

Impact

A user could potentially provide mismatched arrays, leading to loans being transferred to unintended pools or not being transferred at all.

Tools Used

Manual Review

Recommendations

Implement a check at the beginning of the giveLoan function to ensure that the lengths of loanIds and poolIds match. If they don't, the function should revert with an appropriate error message.

Support

FAQs

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