simon135 - If liquiation is not called in few blocks/timestmaps PartyB other positions can't be liquidated and funds will stuck in ` liquidatePositionsPartyB` #342
If liquiation is not called in few blocks/timestmaps PartyB other positions can't be liquidated and funds will stuck in liquidatePositionsPartyB
Summary
because something of the chain can go down/ or just bad incentives it can cause timestamp to go below what the liquidation check needs as shown below
Vulnerability Detail
If liquidation for PartyB is not called in few changes of block.timestamp for monetary reasons of the chain is down/ no incentives
PartyB won't be able to get out of the liquidation state and that Opened Position won't be able to be liquidated
steps:
PartyB gets liquidated
The liquidator makes a call to liquidate 10/20 positions
3 blocks later
Liquidator calls the function and it reverts since partyBLiquidationTimestamp+ timeout so ex : block.timestamp is at 5 and timstamp at first check is 8 and timestamp happens something happens and priceSig.timestmap + timeout >= block.timstamp
ex: 9 in the first check which would make the call revert since block.timestamp is already at 10
Impact
PartyA/PartyB won't be able to use the protocol and funds will be stuck in limbo which if you have huge PartyB and some external chain issue happens or if its just luck then Funds will be stuck and dos for the Partys Which should not happen
Add another function for dealing with that edge case or let admin come in and do something like remove that check
a better way would to allow PartyB to get liquidted again and not allow the nonLiquidated check on the first PartyB liquidation function
simon135
high
If liquiation is not called in few blocks/timestmaps PartyB other positions can't be liquidated and funds will stuck in
liquidatePositionsPartyB
Summary
because something of the chain can go down/ or just bad incentives it can cause timestamp to go below what the liquidation check needs as shown below
Vulnerability Detail
If liquidation for PartyB is not called in few changes of block.timestamp for monetary reasons of the chain is down/ no incentives PartyB won't be able to get out of the liquidation state and that Opened Position won't be able to be liquidated steps: PartyB gets liquidated The liquidator makes a call to liquidate 10/20 positions 3 blocks later Liquidator calls the function and it reverts since
partyBLiquidationTimestamp
+ timeout so ex : block.timestamp is at 5 and timstamp at first check is 8 and timestamp happens something happens andpriceSig.timestmap + timeout
>= block.timstamp ex: 9 in the first check which would make the call revert since block.timestamp is already at 10Impact
PartyA/PartyB won't be able to use the protocol and funds will be stuck in limbo which if you have huge PartyB and some external chain issue happens or if its just luck then Funds will be stuck and dos for the Partys Which should not happen
Code Snippet
https://github.com/sherlock-audit/2023-06-symmetrical/blob/6d2b64b6732fcfbd07c8217897dd233dbb6cd1f5/symmio-core/contracts/facets/liquidation/LiquidationFacetImpl.sol#L318
Tool used
Manual Review
Recommendation
Add another function for dealing with that edge case or let admin come in and do something like remove that check a better way would to allow PartyB to get liquidted again and not allow the nonLiquidated check on the first PartyB liquidation function
Duplicate of #293