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

exploitDog

github логотип

GHSA-2g2g-8p8h-fgwm

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

Описание

Twig: XSS in profiler HtmlDumper via unescaped template and profile names

Description

Twig\Profiler\Dumper\HtmlDumper writes Profile::getTemplate() and Profile::getName() straight into its HTML output without escaping:

protected function formatTemplate(Profile $profile, $prefix): string { return \sprintf('%s└ <span style="background-color: %s">%s</span>', $prefix, self::$colors['template'], $profile->getTemplate()); }

The template name comes from the loader (the array key for ArrayLoader, a row id for a database-backed loader, etc.). When that name is attacker-controlled, the profiler dump emits arbitrary HTML, and any browser that renders it executes the injected markup. This is an output-encoding bug in profiler/debug tooling, not a sandbox escape.

Resolution

HtmlDumper now runs both Profile::getTemplate() and Profile::getName() through htmlspecialchars() before inserting them into the HTML output.

Credits

Twig would like to thank El Kharoubi Iosif for reporting the issue and Nicolas Grekas for fixing it.

Пакеты

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

twig/twig

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

>= 3.0.0, < 3.26.0

3.26.0

EPSS

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

Дефекты

CWE-79

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

CVSS3: 5.4
ubuntu
17 дней назад

Twig is a template language for PHP. From 3.0.0 until 3.26.0, Twig\Profiler\Dumper\HtmlDumper writes Profile::getTemplate() and Profile::getName() into HTML output without escaping, allowing attacker-controlled template or profile names to inject arbitrary HTML when a browser renders the profiler dump. This issue is fixed in version 3.26.0.

CVSS3: 5.4
nvd
17 дней назад

Twig is a template language for PHP. From 3.0.0 until 3.26.0, Twig\Profiler\Dumper\HtmlDumper writes Profile::getTemplate() and Profile::getName() into HTML output without escaping, allowing attacker-controlled template or profile names to inject arbitrary HTML when a browser renders the profiler dump. This issue is fixed in version 3.26.0.

CVSS3: 5.4
debian
17 дней назад

Twig is a template language for PHP. From 3.0.0 until 3.26.0, Twig\Pro ...

EPSS

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

Дефекты

CWE-79