Mend.io Vulnerability Database
The largest open source vulnerability database
What is a Vulnerability ID?
New vulnerability? Tell us about it!
CVE-2026-46628
Published:June 01, 2026
Updated:June 01, 2026
Description The "spaceless" filter is registered with "is_safe => ['html']", which means Twig's autoescaper does not escape its output in an HTML context. As a result, applying "spaceless" to attacker-controlled input that contains markup emits the markup unescaped even when the developer never wrote "|raw" and autoescape is enabled. Example: {% set payload = '<script>alert()</script>' %} {{ payload }} {# escaped #} {{ payload|spaceless }} {# not escaped #} The filter is deprecated but still functional. With the deprecation, some downstream projects (e.g. Drupal modules) have duplicated the filter and inherited the same "is_safe" flag. Resolution The "spaceless" filter no longer marks its output as safe. Documentation has been updated to warn that "spaceless" should not be applied to unsanitised user input. Credits Twig would like to thank Pierre Rudloff for reporting the issue.
Affected Packages
https://github.com/twigphp/Twig.git (GITHUB):
Affected version(s) >=v0.9.0 <v3.26.0
Fix Suggestion:
Update to version v3.26.0
twig/twig (PHP):
Affected version(s) >=dev-ci-fix <v3.26.0
Fix Suggestion:
Update to version v3.26.0
twig/twig (PHP):
Affected version(s) >=v0.9.0 <v3.26.0
Fix Suggestion:
Update to version v3.26.0
Do you need more information?
Contact Us
CVSS v4
Base Score:
1.3
Attack Vector
NETWORK
Attack Complexity
LOW
Attack Requirements
NONE
Privileges Required
NONE
User Interaction
PASSIVE
Vulnerable System Confidentiality
NONE
Vulnerable System Integrity
NONE
Vulnerable System Availability
NONE
Subsequent System Confidentiality
LOW
Subsequent System Integrity
LOW
Subsequent System Availability
NONE
Exploit Maturity
UNREPORTED
CVSS v3
Base Score:
6.1
Attack Vector
NETWORK
Attack Complexity
LOW
Privileges Required
NONE
User Interaction
REQUIRED
Scope
CHANGED
Confidentiality
LOW
Integrity
LOW
Availability
NONE
Weakness Type (CWE)
Improper Encoding or Escaping of Output