CVE-2026-46637
Medium · 5.4Twig: HTML-output filters in twig/* extras incorrectly declared `is_safe => ['all']`
CVSS
5.4
EPSS
0.3%
Published
May 21, 2026
CISA due date
—
The record
Several filters in the `twig/*` extras packages are registered with `is_safe => ['all']`, which tells Twig's autoescaper to treat their output as safe in every context (`html`, `js`, `css`, `url`, ...). The output of these filters is plain text or HTML markup, neither of which is safe in every escaping context. Affected filters: - `html_to_markdown` (`twig/markdown-extra`) emits plain Markdown text. `league/html-to-markdown` decodes HTML entities when producing code spans and fenced blocks, so an attacker-controlled `<code><img src=x onerror=alert(1)></code>` becomes `` `<img src=x onerror=alert(1)>` ``, which renders live when interpolated into an HTML page. - `markdown_to_html` (`twig/markdown-extra`) emits HTML. Safe in an HTML context but not in JS, CSS or URL contexts (e.g. when interpolated into an inline `<script>` block). - `inline_css` (`twig/cssinliner-extra`) emits HTML with inlined styles. Same constraint as `markdown_to_html`. In all three cases, `is_safe => ['all']` causes the autoescaper to emit the output verbatim in any context, even when the developer never wrote `|raw`. In a context such as a JS string or a URL parameter, this produces unescaped HTML and is exploitable as XSS.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|
Related vulnerabilities
- CVE-2026-113732 virtualenv is a tool for creating isolated virtual python environments. CWE-116
- CVE-2026-113726 virtualenv is a tool for creating isolated virtual python environments. CWE-116
- CVE-2026-113725 virtualenv is a tool for creating isolated virtual python environments. CWE-116
- CVE-2026-104250 The unstructured library provides open-source components for ingesting and pre-processing… CWE-116
- CVE-2026-107823 MariaDB server is a community developed fork of MySQL server. CWE-116
- CVE-2026-106444 Handlebars provides the power necessary to let users build semantic templates. CWE-116
- CVE-2026-77404 RabbitMQ amqp091-go is a Go AMQP 0.9.1 client. CWE-116
- CVE-2026-88060 Angular is a development platform for building mobile and desktop web applications using… CWE-116