Back to list

Twig: The `spaceless` filter implicitly marks its output as safe — GHSA-4J38-F5CW-54H7

GitHub · GitHub · GHSA-4J38-F5CW-54H7

ID
GHSA-4J38-F5CW-54H7
Date
Source
GitHub
Vendor
GitHub
Threat
low
CVSS
1.3
EPSS
0

Summary

### 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: ```twig {% set payload = '<script>alert()</script>' %} {{ payload }}…

Timeline

Published by source
2026-05-21

Risk context

  • Reported severity or threat level: low.
  • Reported CVSS score: 1.3 out of 10.
  • Reported EPSS value: 0.
  • Review exposure for the affected product or family: composer: twig/twig.

Product

composer: twig/twig

What to do

General, cautious steps (verify details in the official source):

  • Review exposure and plan remediation based on risk and environment.
  • Identify affected product versions in your inventory and verify whether you are impacted.
  • Apply vendor patches/updates or recommended mitigations as soon as available.
  • Read the official advisory for exact affected versions and remediation steps.

Official advisory

Evidence and provenance

Canonical advisory ID
GHSA-4J38-F5CW-54H7
Source
GitHub
Vendor
GitHub
Published by source
2026-05-21
Last source activity
2026-05-21
Additional identifiers
CVE-2026-46628
Curated by
hlukh.ch

Related advisories and connections

These advisories are connected by shared CVE, product, vendor, source, or time signals.