Twig: HTML-output filters in twig/* extras incorrectly declared `is_safe => ['all']`
twigphp Twig · twig cssinliner-extra · twig markdown-extra
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| twig/markdown-extra Packagist |
|
|
| twig/cssinliner-extra Packagist |
|
|
twigphp Twig · twig cssinliner-extra · twig markdown-extra
| Product | Affected | Fixed in |
|---|---|---|
| twig/markdown-extra Packagist |
|
|
| twig/cssinliner-extra Packagist |
|
|
Twig is a template language for PHP. Prior to 3.26.0, several filters in twig/markdown-extra and twig/cssinliner-extra are registered with is_safe => [all], causing Twig to treat plain text or HTML output as safe in HTML, JavaScript, CSS, URL, and other contexts where the output is not properly escaped. This issue is fixed in version 3.26.0.
From the CVE record · GitHub_M
Before 3.26.0, filters in twig/markdown-extra and twig/cssinliner-extra incorrectly mark their output as safe across HTML, JavaScript, CSS, URL, and other contexts. If attacker-controlled content passes through these filters, it may bypass appropriate escaping and enable cross-site scripting. Authentication and user-interaction requirements are not specified.
Teams using twig/markdown-extra or twig/cssinliner-extra versions earlier than 3.26.0 should check their installations.