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

Missing check for equal length arrays in `giveLoan`

Summary

The giveLoan function does not check if loanIds and poolIds have the same length. This can lead to unexpected results.

Vulnerability Details

Common practice in situations is to verify that the lengths are equal to ensure the user did not make a mistake.

Impact

The transaction will revert during _updatePoolBalance(poolId, pool.poolBalance - totalDebt); as pool.poolBalance - totalDebt would become negative and revert.

Tools Used

manual review

Recommendations

add
require(loanIds.length == poolIds.length, "mismatched array lengths");

Support

FAQs

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

Give us feedback!