{"id":"CVE-2026-55865","aliases":["GHSA-vq2f-vcc9-j8mv","PYSEC-2026-3035"],"url":"https://o3.security/vulnerability/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```","published":"2026-07-09T20:34:38.618Z","modified":"2026-08-12T03:51:41.128211122Z","cvss":null,"epss":{"score":0.00451,"percentile":0.38372,"asOf":"2026-09-17"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"PyPI","name":"python-liquid","fixedVersion":"2.2.1"}],"fix":{"url":"https://github.com/jg-rp/liquid/commit/26db8931cf35e8433c1ca506fc32c3bb62f743d4","label":"jg-rp/liquid@26db893"},"references":[{"type":"WEB","url":"https://github.com/jg-rp/liquid/releases/tag/v2.2.1"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/55xxx/CVE-2026-55865.json"},{"type":"ADVISORY","url":"https://github.com/jg-rp/liquid/security/advisories/GHSA-vq2f-vcc9-j8mv"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-55865"},{"type":"FIX","url":"https://github.com/jg-rp/liquid/commit/26db8931cf35e8433c1ca506fc32c3bb62f743d4"},{"type":"PACKAGE","url":"https://github.com/jg-rp/liquid"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-12T03:51:41.128211122Z"}}