# PartyA and PartyB nonce is not incremented in any of the liquidation functions which can lead to all protocol funds being stolen in some cases

Liquidation functions in Symmetrical don't bump party nonces, letting a self-controlled partyB reuse a stale upnl signature to deallocate inflated balance and drain protocol funds.

- Payout: Contest reward
- Severity: high
- Program: Symmetrical
- Credited: bin2chen
- Disclosed: 2023-06-05
- Write-up quality: 8/10
- Original: https://github.com/sherlock-audit/2023-06-symmetrical-judging/issues/190
- Library page: https://bugbountylibrary.com/r/sherlock%3A2023-06-symmetrical%3AH-3
- Tags: domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:evm tech:solidity technique:chained technique:source-review vuln:accounting-error vuln:business-logic vuln:signature-replay

**Target:** Solidity diamond proxy (LiquidationFacetImpl / AccountFacet)
**Root cause:** Liquidation functions mutate party allocatedBalances and upnl but never increment partyA/partyB nonces, so previously signed upnl signatures remain valid against the new state.
**Steps:**
1. Control partyA, partyB, and liquidator; deposit collateral.
2. Open two opposite positions with slightly different sizes and far-off openPrice so partyA becomes liquidatable on price move.
3. Call `liquidatePartyA` and `setSymbolsPrice` (no bad debt).
4. Sign `singleUpnlSig` for partyB while it shows small profit.
5. Liquidator calls `liquidatePositionsPartyA` with only the losing position id, inflating partyB allocatedBalance.
6. Reuse the old `singleUpnlSig` in `deallocateForPartyB` to deallocate the inflated balance.
7. Call `withdraw` to drain funds exceeding total protocol deposits.
**How found:** Code review of LiquidationFacetImpl noting state changes (allocatedBalances, upnl, position deletion) without corresponding nonce increments, then identifying functions that ignore liquidation status and accept old signatures.
**Exploitation:** Attacker controls all roles, engineers a liquidatable partyA with offsetting positions, liquidates only the loss-side position to inflate partyB's allocatedBalance, then replays the pre-liquidation upnl signature (nonce unchanged) to deallocate and withdraw more than deposited, draining other users' funds.
**Escalation:** Single stale signature replay escalates from a small controlled position to theft of all protocol funds.
**Insight:** When a protocol uses signed off-chain state (upnl/balances) gated by nonces, audit every state-mutating path—especially liquidation and admin paths—for missing nonce increments; any mutation that changes a signed value without bumping the nonce enables replay of stale signatures.
