# CVE-2026-46634: Twig: `template_from_string()` escapes a SourcePolicy-driven sandbox via synthesized template name

- Severity: High 7.7 (CVSS:4.0, scored by GitHub_M) `CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/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.51%, higher than 45% of CVEs (2026-12-01)
- Published: 2026-05-21T21:25:12.000Z
- Modified: 2026-10-24T22:10:00.210Z
- Also known as: GHSA-24x9-r6q4-q93w
- Weaknesses: CWE-693
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: GitHub_M

## Description

Twig is a template language for PHP. From 3.9.0 until 3.26.0, template_from_string() compiles an inner template under a synthesized __string_template__<hash> name that can fall outside a SourcePolicyInterface sandbox decision, allowing a sandboxed template that can call template_from_string and include to render an inner template without security policy enforcement. This issue is fixed in version 3.26.0.

(As written by CVE List.)

## Affected

- twigphp Twig: >= 3.9.0, < 3.26.0
- twig/twig (Packagist): from 3.9.0 before 3.26.0
- symfony twig: from 3.9.0 before 3.26.0

## Every score

- GitHub_M: CVSS:4.0 7.7 High `CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`
- GitHub: rating Medium
- NVD: CVSS:3.1 9.8 Critical `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://github.com/twigphp/Twig/security/advisories/GHSA-24x9-r6q4-q93w> (vendor-advisory, web)
- <https://github.com/twigphp/Twig/commit/1cde8f2b62463f85d47995fc25f8241cb409d915> (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-46634.yaml> (web)
- <https://github.com/twigphp/Twig> (package)
- <https://symfony.com/cve-2026-46634> (web)

## Sources

- CVE List: [CVE-2026-46634](https://www.cve.org/CVERecord?id=CVE-2026-46634), CVE Terms of Use, modified 2026-07-29
- GitHub Advisory Database: [GHSA-24x9-r6q4-q93w](https://github.com/advisories/GHSA-24x9-r6q4-q93w), CC-BY-4.0, modified 2026-09-10
- NVD: [CVE-2026-46634](https://nvd.nist.gov/vuln/detail/CVE-2026-46634), Public domain, modified 2026-10-24

---

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