borrow() function have unbounded loop leads to dos of gas.limit
Summary
borrow() function have unbounded loop leads to dos of gas.limit
Vulnerability Detail
When user try to borrow loan with large amount of NFT's then in borrow() function there is loop where calls each NFT's OfferAgrs[] args array from stroage when user try submit large of array which leads to dos of block.gas limit.
Use a different data structure for the OfferArg[] args, such as an EnumerableMap, to reduce code maintenance overhead and ensure necessary operations can be performed in constant gas
Set limit to number of borrowing in one transaction .
pavankv241
medium
borrow() function have unbounded loop leads to dos of gas.limit
Summary
borrow() function have unbounded loop leads to dos of gas.limit
Vulnerability Detail
When user try to borrow loan with large amount of NFT's then in borrow() function there is loop where calls each NFT's OfferAgrs[] args array from stroage when user try submit large of array which leads to dos of block.gas limit.
Impact
Dos of gas limit in borrow() loop
Code Snippet
https://github.com/sherlock-audit/2023-02-kairos/blob/main/kairos-contracts/src/BorrowFacet.sol#L41
Tool used
Manual Review
Recommendation