Submitted by ladboy233
https://github.com/code-423n4/2023-11-betafinance/blob/0f1bb077afe8e8e03093c8f26dc0b7a2983c3e47/Omni_Protocol/src/OmniPool.sol#L348 
https://github.com/code-423n4/2023-11-betafinance/blob/0f1bb077afe8e8e03093c8f26dc0b7a2983c3e47/Omni_Protocol/src/OmniToken.sol#L180
paucheTranche state can be set to arbitrary value
The protocol has this concept of tranche id and borrower tier, the higher borrower tier means higher risk.
Lower borrower tier means lower risk.
When liquidation happens, if the borrowTrueValue is greater than depositTrueValue, which can happen because of the underlying oracle price can change:
When the pauseTranche id is set to the borrower tier in this line of code, the user that deposited below the paused tranche id should not be able to withdraw / tranche id share because this check is in-place:
The problem is that the paucheTranche state can be set to arbitrary value.
Suppose a user has borrower tier 10 and borrowTrueValue exceed depositTrueValue, the pauseTranche is set to 10, then a second user has borrower tier 0, he is subject to liquidation as well.
borrowTrueValue exceed depositTrueValue as well.
The pauseTranche is reset to 0 again, which defeats the check of:
Change the code to:
cccz (Judge) commented:
Ladboy233 (Warden) commented:
cccz (Judge) decreased severity to Medium and commented:
allenjlee (BetaFinance) confirmed and commented:
