Home / Advisories / CVE-2026-46634 CVE-2026-46634: Twig: `template_from_string()` escapes a SourcePolicy-driven sandbox via synthesized template name medium Affects twig/twig . Feed 2026.11.23.2, updated 2026-11-23; published 2026-05-21 ; advisory modified 2026-09-10 .
Twig: `template_from_string()` escapes a SourcePolicy-driven sandbox via synthesized template name Package twig/twig Composer Affected versions >=3.9.0 and <3.26.0Fixed in 3.26.0Severity medium Exploitation not on CISA KEV · EPSS 1% (50.4th percentile) Published 2026-05-21 Source osv.dev References Quick answers Is CVE-2026-46634 being actively exploited?
It is not on CISA's Known Exploited Vulnerabilities list today.
Which version fixes CVE-2026-46634?
twig/twig: 3.26.0.
How do I check whether I am affected?
Run `phpwarden deps composer.lock`. phpwarden checks the exact version you have installed against this advisory.
Am I affected? Find out in one command. phpwarden checks your composer.lock against this advisory and 21,000+ others, ranked by real-world exploitation (CISA KEV + EPSS). Free, offline, open data.
# PHP projects (recommended)
composer require --dev phpwarden/phpwarden
# then
vendor/bin/phpwarden deps composer.lock
# or, without Composer
pipx install phpwarden && phpwarden deps composer.lockOr keep it checked automatically: GitHub Action · pre-commit hook · GitLab CI · Laravel artisan command
Install docs How findings are ranked Related advisories CVE-2022-23614 high Code injection in Twig same package: twig/twig CVE-2015-7809 high Twig remote code execution in templates same package: twig/twig CVE-2022-39261 high Twig may load a template outside a configured directory when using the filesystem loader same package: twig/twig CVE-2019-9942 low Twig Sandbox Information Disclosure same package: twig/twig CVE-2024-45411 high Twig has a possible sandbox bypass same package: twig/twig CVE-2026-46633 critical Twig: PHP code injection via `{% use %}` template name same package: twig/twig