# Liquidation path reverts on valid accounts

Liquidation, close, or repay reverting on stale state, sentinel prices, bad math, or shared oracle gates

_Area: DeFi oracles, liquidations and flash loans. Seen in 4 disclosed reports; latest 2026-07-11. Updated 2026-11-14._

## How it works
A liquidation, close, or repay path should succeed whenever the account is genuinely underwater. It reverts instead because a precondition fails for a reason unrelated to solvency: a peripheral reimplementation of the closable math includes the in-flight current position [E1](https://bugbountylibrary.com/r/sherlock%3A2023-10-perennial%3AM-9.md), solvency is required at both market price and execution price so a favorable close price cannot restore it [E2](https://bugbountylibrary.com/r/sherlock%3A2023-08-symmetrical%3AM-1.md), a cap exceeds a downstream numeric bound [E3](https://bugbountylibrary.com/r/c4%3A2026-02-jupiter-lend%3AM-01.md), or a shared entrypoint gates every operation behind one oracle-deviation check [E4](https://bugbountylibrary.com/r/c4%3A2025-12-panoptic-next-core%3AM-06.md). The broken assumption is that "the path reverts" implies "the account is safe." When the revert is caused by state an attacker can move or by a value the protocol itself produces, the account stays unliquidated and bad debt accrues.

## Where it shows up
- Peripheral or off-chain reimplementations of a core invariant with different loop bounds (`<=` vs `<`) [E1](https://bugbountylibrary.com/r/sherlock%3A2023-10-perennial%3AM-9.md)
- Solvency checks requiring health at both market price and execution price [E2](https://bugbountylibrary.com/r/sherlock%3A2023-08-symmetrical%3AM-1.md)
- Caps or thresholds derived from an inverse conversion but applied to a forward path with extra multipliers [E3](https://bugbountylibrary.com/r/c4%3A2026-02-jupiter-lend%3AM-01.md)
- A single entrypoint that checks oracle deviation before branching on operation type, so liquidations, exercises, and settlements share one gate [E4](https://bugbountylibrary.com/r/c4%3A2025-12-panoptic-next-core%3AM-06.md)

## How to review
For each liquidation/close/repay path, ask: can this revert while the account is underwater? Trace every revert to its source and classify it as solvency-related or environmental. The invariant: **if the account is insolvent at the execution price, the path must not revert for any reason an attacker or oracle can trigger.** Confirm solvency is evaluated only at the price the operation executes at [E2](https://bugbountylibrary.com/r/sherlock%3A2023-08-symmetrical%3AM-1.md), verify caps against each downstream bound [E3](https://bugbountylibrary.com/r/c4%3A2026-02-jupiter-lend%3AM-01.md), and check whether a shared gate runs before operation branching [E4](https://bugbountylibrary.com/r/c4%3A2025-12-panoptic-next-core%3AM-06.md).

## How finders spotted it
- Compared the core contract's closable loop (`id < currentId`) against a peripheral copy (`id <= currentId`) and reasoned through the in-flight-position edge case [E1](https://bugbountylibrary.com/r/sherlock%3A2023-10-perennial%3AM-9.md)
- Re-checked a sibling path after a prior fix only patched one of two (request vs fill) [E2](https://bugbountylibrary.com/r/sherlock%3A2023-08-symmetrical%3AM-1.md)
- Recomputed the forward path after a developer comment showed the cap was verified only for the inverse [E3](https://bugbountylibrary.com/r/c4%3A2026-02-jupiter-lend%3AM-01.md)
- Read a shared entrypoint and saw the oracle check ran before operation branching; built PoCs for each operation type [E4](https://bugbountylibrary.com/r/c4%3A2025-12-panoptic-next-core%3AM-06.md)

## Variants seen
- Loop-bound mismatch in a peripheral reimplementation of the closable invariant [E1](https://bugbountylibrary.com/r/sherlock%3A2023-10-perennial%3AM-9.md)
- Solvency checked at the wrong price [E2](https://bugbountylibrary.com/r/sherlock%3A2023-08-symmetrical%3AM-1.md)
- Cap exceeding a downstream numeric bound [E3](https://bugbountylibrary.com/r/c4%3A2026-02-jupiter-lend%3AM-01.md)
- Shared oracle-deviation gate blocking all operations [E4](https://bugbountylibrary.com/r/c4%3A2025-12-panoptic-next-core%3AM-06.md)

## Why fixes fail
A prior fix addressed only the request-to-close path; the fill path kept the same flawed solvency logic [E2](https://bugbountylibrary.com/r/sherlock%3A2023-08-symmetrical%3AM-1.md). A cap verified for the inverse conversion was applied to the forward path, where the extra multiplier overflows the downstream bound [E3](https://bugbountylibrary.com/r/c4%3A2026-02-jupiter-lend%3AM-01.md).

## Impact and severity
Blocks liquidations, force exercises, and settlements, extending insolvency and socializing losses [E4](https://bugbountylibrary.com/r/c4%3A2025-12-panoptic-next-core%3AM-06.md); DoS of the liquidation engine during market crashes, causing insolvency [E3](https://bugbountylibrary.com/r/c4%3A2026-02-jupiter-lend%3AM-01.md); enables unfair liquidation of a solvent borrower [E2](https://bugbountylibrary.com/r/sherlock%3A2023-08-symmetrical%3AM-1.md); liquidations revert on valid accounts [E1](https://bugbountylibrary.com/r/sherlock%3A2023-10-perennial%3AM-9.md). Impact rises when the revert is attacker-triggerable and blocks time-sensitive paths, scaling to protocol-wide bad debt.

## Evidence
- E1: https://bugbountylibrary.com/r/sherlock%3A2023-10-perennial%3AM-9.md
- E2: https://bugbountylibrary.com/r/sherlock%3A2023-08-symmetrical%3AM-1.md
- E3: https://bugbountylibrary.com/r/c4%3A2026-02-jupiter-lend%3AM-01.md
- E4: https://bugbountylibrary.com/r/c4%3A2025-12-panoptic-next-core%3AM-06.md
