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.
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.
A user could potentially provide mismatched arrays, leading to loans being transferred to unintended pools or not being transferred at all.
Manual Review
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.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.