Vulnerabilities in pkg:pypi/python-liquid
PACKAGECVE-2026-55865 is a MODERATE infinite loop when parsing malformed vulnerability (CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')) affecting Python Liquid libraries in the PyPI ecosystem. The issue involves infinite loop when parsing malformed `{% case %}` tags. Remediation is available by upgrading affected packages to version 2.2.1.
pkg:pypi/python-liquid
Vulnerability advisories affecting package pkg:pypi/python-liquid. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-vq2f-vcc9-j8mv | CVE-2026-55865 | MODERATE | Python Liquid: Infinite loop when parsing malformed `{% case %}` tags |
| GHSA-8p4x-wr7x-3788 | CVE-2026-45017 | HIGH | python-liquid: Absolute paths escape filesystem loader search path |
CVE-2026-55865 at a Glance
How to Fix CVE-2026-55865
To remediate this vulnerability, upgrade all affected Python Liquid dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install python-liquid>=2.2.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show python-liquid
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2026-55865, inspect your installed packages using pip:
pip show python-liquid
Analyze the terminal output to locate any version of Python Liquid in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.2.1), your application is affected.
Note: The pip show python-liquid command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop'), where the product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop. In Python Liquid, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2026-55865 Affected Python Liquid Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
python-liquid
|
PyPI |
< 2.2.1
|
2.2.1
|
References
Frequently Asked Questions
What is CVE-2026-55865?
Which Python Liquid versions are affected?
What version fixes CVE-2026-55865?
Is python-liquid affected?
What CWE is associated with CVE-2026-55865?
How can I check PyPI dependencies for CVE-2026-55865?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-vq2f-vcc9-j8mv",
"modified" : "2026-06-19T20:46:34Z",
"published" : "2026-06-19T20:46:34Z",
"aliases" : [ "CVE-2026-55865" ],
"summary" : "Python Liquid: Infinite loop when parsing malformed `{% case %}` tags",
"details" : "### Impact\nGiven a malformed `{% case %}` tag without associated `{% when %}` or `{% else %}` block, and no terminating `{% endcase %}` tag, Python Liquid hangs in an infinite loop at parse time. This allows malicious template authors to craft templates for a denial of service attack.\n\n### Patches\nThe issue is fixed in version 2.2.1 with the correction of the `liquid.TokenStream.eof` attribute. The `kind` and `value` of the special EOF token are now the same, so either can be tested against `liquid.token.TOKEN_EOF`.\n\n### Workarounds\nManually correct the definition of `liquid.TokenStream.eof` before parsing any templates.\n\n```python\nimport liquid\nfrom liquid.token import TOKEN_EOF\n\nliquid.stream.TokenStream.eof = liquid.Token(TOKEN_EOF, TOKEN_EOF, -1, \"\")\n\n# ...\n```",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "python-liquid"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.2.1"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/jg-rp/liquid/security/advisories/GHSA-vq2f-vcc9-j8mv"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/jg-rp/liquid"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-835" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2026-06-19T20:46:34Z",
"nvd_published_at" : null
}
}