If the user doesn't use type(uint256).max for the input amount but fully redeems his assets, the user won't exit the market because isRedeemFull won't be true.
address[] memory userEnteredMarkets = allEnteredMarkets[user];
for (uint256 i = 0; i < userEnteredMarkets.length; i++) {
When users don't exit the market correctly and continue entering new markets, allEnteredMarkets will grow too much and out of gas _isLiquidatable() and _getAccountLiquidity() functions.
Impact
Users may not correctly exit market and can DOS liquidate function.
Nyx
medium
Users wont exit market correctly when input amount is not uint256.max
Summary
Vulnerability Detail
If the user doesn't use type(uint256).max for the input amount but fully redeems his assets, the user won't exit the market because isRedeemFull won't be true.
When users don't exit the market correctly and continue entering new markets, allEnteredMarkets will grow too much and out of gas _isLiquidatable() and _getAccountLiquidity() functions.
Impact
Users may not correctly exit market and can DOS liquidate function.
Code Snippet
https://github.com/sherlock-audit/2023-05-ironbank/blob/main/ib-v2/src/protocol/pool/IronBank.sol#L421-L427
https://github.com/sherlock-audit/2023-05-ironbank/blob/main/ib-v2/src/protocol/pool/IronBank.sol#L441-L443
https://github.com/sherlock-audit/2023-05-ironbank/blob/main/ib-v2/src/protocol/pool/IronBank.sol#L1069-L1070
Tool used
Manual Review
Recommendation