Python Liquid: Infinite loop when parsing malformed `{% case %}` tags
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.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2026-55865
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 8 Nov 2026, 02:37 UTC · Revision 1
Source evidence
Python Liquid: Infinite loop when parsing malformed `{% case %}` tags
core-osv · Original sourcePublished 9 Jul 2026, 20:34 UTC
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.
osv:CVE-2026-55865
Complete source record
{
"id": "14117e5850fe14e7c1a0b3d6e1d239eb4ca9f9abbe98f57eb11c2091906e557e",
"url": "https://osv.dev/vulnerability/CVE-2026-55865",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "Python Liquid: Infinite loop when parsing malformed `{% case %}` tags",
"summary": "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.",
"evidence": "osv:CVE-2026-55865",
"products": [],
"severity": "high",
"structured": {
"id": "CVE-2026-55865",
"aliases": [
"CVE-2026-55865",
"GHSA-vq2f-vcc9-j8mv",
"PYSEC-2026-3035"
],
"metrics": [
{
"type": "CVSS_V4",
"score": "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"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/jg-rp/liquid",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "1b915914fdb154a0dfbffbfa796c520a6e8de905"
},
{
"fixed": "26db8931cf35e8433c1ca506fc32c3bb62f743d4"
}
],
"database_specific": {
"extracted_events": [
{
"range": [
{
"introduced": "0"
},
{
"fixed": "2.2.1"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StringRangeExpression"
},
{
"range": [
{
"fixed": "26db8931cf35e8433c1ca506fc32c3bb62f743d4"
}
],
"source": "REFERENCES_COMMIT"
},
{
"range": [
{
"fixed": "1b915914fdb154a0dfbffbfa796c520a6e8de905"
}
],
"source": "REFERENCES_TAG",
"original_tag": "v2.2.1"
}
]
}
}
],
"versions": [
"v2.2.0",
"v2.1.0",
"v2.0.2",
"v2.0.1",
"v2.0.0",
"v1.13.0",
"v1.12.2",
"v1.12.1",
"v1.12.0",
"v1.11.0",
"v1.10.2",
"v1.10.0",
"v1.9.4",
"v1.9.3",
"v1.9.2",
"v1.9.1",
"v1.9.0",
"v1.8.1",
"v1.8.0",
"v1.7.0",
"v1.6.1",
"v1.6.0",
"v1.5.1",
"v1.5.0",
"v1.4.7",
"v1.4.6",
"v1.4.5",
"v1.4.3",
"v1.4.0",
"v1.3.0",
"v1.2.0",
"v1.1.7",
"v1.1.5",
"v1.1.3",
"v1.1.0",
"v1.0.0",
"v0.9.0",
"v0.8.0",
"v0.7.7",
"v0.7.2",
"v0.6.2"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-55865.json"
}
}
],
"modified": "2026-10-28T02:30:52.947497285Z",
"provider": "osv",
"references": [
"https://github.com/jg-rp/liquid/releases/tag/v2.2.1",
"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/55xxx/CVE-2026-55865.json",
"https://github.com/jg-rp/liquid/security/advisories/GHSA-vq2f-vcc9-j8mv",
"https://nvd.nist.gov/vuln/detail/CVE-2026-55865",
"https://github.com/jg-rp/liquid/commit/26db8931cf35e8433c1ca506fc32c3bb62f743d4"
],
"provider_metadata": {
"cwe_ids": [
"CWE-835"
],
"cna_assigner": "GitHub_M",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/55xxx/CVE-2026-55865.json"
}
},
"related_cves": [
{
"value": "CVE-2026-55865",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 521854,
"published_at": "2026-07-09T20:34:38.618+00:00"
}