{"id":"CVE-2026-46634","published":"2026-07-14T21:19:17Z","modified":"2026-07-29T18:26:17Z","title":"Twig: `template_from_string()` escapes a SourcePolicy-driven sandbox via synthesized template name","vendor":"twigphp","product":"Twig","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.7,"severity":"HIGH","version":"4.0","vector":"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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00616,"percentile":0.43753,"provenance":"source"},"cwes":[{"id":"CWE-693","name":"Protection Mechanism Failure"}],"references":[{"url":"https://github.com/twigphp/Twig/security/advisories/GHSA-24x9-r6q4-q93w","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/twigphp/Twig/commit/1cde8f2b62463f85d47995fc25f8241cb409d915","tags":["x_refsource_MISC"]},{"url":"https://github.com/twigphp/Twig/releases/tag/v3.26.0","tags":["x_refsource_MISC"]}],"priority":{"score":14.1,"factors":[{"name":"EPSS percentile","points":8.75},{"name":"CVSS severity","points":5.39}]},"vendorSlug":"twigphp","affectedVersions":[{"vendor":"twigphp","product":"Twig","versions":[">= 3.9.0, < 3.26.0"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2026-07-16T03:55:36.244422Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"Packagist","package":"twig/twig","vulnerableRanges":[">=3.9.0, <3.26.0"],"patched":["3.26.0"],"from":["GHSA-24x9-r6q4-q93w"],"provenance":"source"}],"summary":{"text":"Twig, the PHP template language, has a sandbox escape in its template_from_string() function, which compiles inner templates under a synthesized name that can bypass SourcePolicyInterface sandbox decisions. An attacker who can supply or control a sandboxed template that is allowed to call template_from_string and include can render an inner template without security policy enforcement; this requires low-privilege authentication and no user interaction, and the attacker must already be able to author templates within the sandbox.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:28:48Z"},"euvd":{"id":"EUVD-2026-44565","exploited":false,"provenance":"source"}}