# CVE-2026-46628: Twig: The `spaceless` filter implicitly marks its output as safe

- Severity: Medium 5.1 (CVSS:4.0, scored by GitHub_M) `CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.17%, higher than 6% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-05-21T21:21:35.000Z
- Modified: 2026-10-24T22:10:00.210Z
- Also known as: GHSA-4j38-f5cw-54h7
- Weaknesses: CWE-116
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

Twig is a template language for PHP. Prior to 3.26.0, the deprecated spaceless filter is registered as safe for HTML, causing Twig autoescaping to emit attacker-controlled markup unescaped when spaceless is applied to untrusted input. This issue is fixed in version 3.26.0.

(As written by CVE List.)

## Affected

- twigphp Twig: < 3.26.0
- twig/twig (Packagist): before 3.26.0
- symfony twig: before 3.26.0

## Every score

- GitHub_M: CVSS:4.0 5.1 Medium `CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N`
- GitHub: CVSS:4.0 Low `CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N/E:U`
- NVD: CVSS:3.1 5.4 Medium `CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N`

## References

- <https://github.com/twigphp/Twig/security/advisories/GHSA-4j38-f5cw-54h7> (exploit, vendor-advisory, web)
- <https://github.com/twigphp/Twig/commit/3190b9ae12614dfd58cc5d8f394bac4708b17913> (patch)
- <https://github.com/twigphp/Twig/releases/tag/v3.26.0> (release-notes)
- <https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2026-46628.yaml> (web)
- <https://github.com/twigphp/Twig> (package)
- <https://symfony.com/cve-2026-46628> (web)

## Sources

- CVE List: [CVE-2026-46628](https://www.cve.org/CVERecord?id=CVE-2026-46628), CVE Terms of Use, modified 2026-07-15
- GitHub Advisory Database: [GHSA-4j38-f5cw-54h7](https://github.com/advisories/GHSA-4j38-f5cw-54h7), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-46628](https://nvd.nist.gov/vuln/detail/CVE-2026-46628), Public domain, modified 2026-10-24

---

Page: https://cve.day/CVE-2026-46628 · Whole record: https://cve.day/CVE-2026-46628.json · Rebuilt by cve.day 2026-11-25T22:59:28.236Z
