{"id":"CVE-2026-55865","aliases":["CVE-2026-55865","GHSA-vq2f-vcc9-j8mv","PYSEC-2026-3035"],"related":[],"kind":"vulnerability","state":"published","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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### 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```","format":"markdown","source":"ghsa"},{"lang":"es","text":"Python Liquid es un motor Python para el lenguaje de plantillas Liquid. Anteriormente a la 2.2.1, dada una etiqueta {% case %} malformada sin un bloque {% when %} o {% else %} asociado y sin una etiqueta de cierre {% endcase %}, Python Liquid se bloqueaba en un bucle infinito en tiempo de análisis porque liquid.TokenStream.eof no proporcionaba el token EOF que coincidiera con los campos kind y value, lo que permitía a autores de plantillas maliciosos crear plantillas para un ataque de denegación de servicio. Este problema se ha corregido en la versión 2.2.1.","source":"nvd"}],"published":"2026-06-19T20:46:34.000Z","modified":"2026-10-25T17:10:00.197Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":7.1,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:4.0","vector":"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"}],"cwes":["CWE-835"],"affected":[{"ranges":[{"version":"< 2.2.1","status":"affected"}],"vendor":"jg-rp","product":"liquid","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.2.1"}],"ecosystem":"PyPI","package":"python-liquid","purl":"pkg:pypi/python-liquid","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"2.2.1"}],"ecosystem":"PyPI","package":"python-liquid","purl":"pkg:pypi/python-liquid","source":"pysec"}],"references":[{"url":"https://github.com/jg-rp/liquid/security/advisories/GHSA-vq2f-vcc9-j8mv","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/jg-rp/liquid/commit/26db8931cf35e8433c1ca506fc32c3bb62f743d4","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/jg-rp/liquid/releases/tag/v2.2.1","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/jg-rp/liquid","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/python-liquid","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-vq2f-vcc9-j8mv","tags":["advisory"],"sources":["pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-55865","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-07-14T01:15:58.872Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-55865","url":"https://www.cve.org/CVERecord?id=CVE-2026-55865","licence":"CVE Terms of Use","modified":"2026-07-14T01:16:10.895Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-vq2f-vcc9-j8mv","url":"https://github.com/advisories/GHSA-vq2f-vcc9-j8mv","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:09.596Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-55865","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-55865","licence":"Public domain","modified":"2026-10-25T17:10:00.197Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3035","url":"https://osv.dev/vulnerability/PYSEC-2026-3035","licence":"CC-BY-4.0","modified":"2026-07-13T16:33:29.033Z"}],"updatedAt":"2026-11-25T22:59:27.555Z","epss":{"score":0.0026,"percentile":0.18851,"date":"2026-12-02T12:00:21.000Z"}}