Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-vq2f-vcc9-j8mv

Опубликовано: 19 июн. 2026
Источник: github
Github: Прошло ревью
CVSS4: 5.3

Описание

Python Liquid: Infinite loop when parsing malformed {% case %} tags

Impact

Given 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.

Patches

The 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.

Workarounds

Manually correct the definition of liquid.TokenStream.eof before parsing any templates.

import liquid from liquid.token import TOKEN_EOF liquid.stream.TokenStream.eof = liquid.Token(TOKEN_EOF, TOKEN_EOF, -1, "") # ...

Пакеты

Наименование

python-liquid

pip
Затронутые версииВерсия исправления

< 2.2.1

2.2.1

EPSS

Процентиль: 18%
0.0026
Низкий

5.3 Medium

CVSS4

Дефекты

CWE-835

Связанные уязвимости

nvd
2 месяца назад

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.

EPSS

Процентиль: 18%
0.0026
Низкий

5.3 Medium

CVSS4

Дефекты

CWE-835