# CVE-2026-55865: Python Liquid: Infinite loop when parsing malformed `{% case %}` tags

> Malformed Liquid template tags cause an infinite loop during parsing, allowing attackers to trigger a denial of service in applications using the library.

- **Severity:** High 7.1 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 9 Jul 2026
- **Updated:** 14 Jul 2026
- **Also known as:** ECHO-3a95-2e3a-8c10, GHSA-vq2f-vcc9-j8mv, PYSEC-2026-3035

## What is CVE-2026-55865?

CVE-2026-55865 is a high-severity denial of service vulnerability in jg-rp liquid, published on 9 Jul 2026. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

Python Liquid is a Python engine for the Liquid template language. Prior to 2.2.1, given a malformed {% case %} tag without an associated {% when %} or {% else %} block and no terminating {% endcase %} tag, Python Liquid hangs in an infinite loop at parse time because liquid.TokenStream.eof did not give the EOF token matching kind and value fields, allowing malicious template authors to craft templates for a denial of service attack. This issue is fixed in version 2.2.1.

Weakness: CWE-835 (Loop with Unreachable Exit Condition)

## Which versions are affected by CVE-2026-55865?

3 open source packages ship an affected version, including python-liquid.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `python-liquid` | PyPI | All versions | 2.2.1 |
| `python-liquid` | PyPI | All versions | 2.2.1 |
| `python-liquid` | PyPI | All versions | 2.2.1 |

## How do I fix CVE-2026-55865?

Upgrade python-liquid to 2.2.1 or later.

## Is CVE-2026-55865 being exploited?

There is no known exploitation of CVE-2026-55865 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-55865 and fix it if it is affected.

What it is: CVE-2026-55865 is a high-severity denial of service vulnerability in jg-rp liquid, published on 9 Jul 2026. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-55865 in the wild and no public exploit code.

Affected packages and fixed versions:
- python-liquid (PyPI): affected all versions; fixed in 2.2.1
- python-liquid (PyPI): affected all versions; fixed in 2.2.1
- python-liquid (PyPI): affected all versions; fixed in 2.2.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-55865/ (Markdown: https://insights.sbomify.com/CVE-2026-55865/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-55865
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-55865
- OSV: https://osv.dev/vulnerability/CVE-2026-55865

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-55865/
Summaries are generated and may contain mistakes; the official description above is the record.
