high8.1
CVE-2026-46638
Twig: `{% sandbox %}{% include %}` skips checkSecurity() on cached templates (incomplete fix for CVE-2024-45411)
Impact
Twig is a template language for PHP. Prior to 3.26.0, {% sandbox %}{% include %} can include a template that was previously loaded outside the sandbox without re-invoking checkSecurity(), allowing the cached template to use tags, filters, and functions that should have been denied by SecurityPolicy::checkSecurity(). This issue is fixed in version 3.26.0.
Affected packages
| Ecosystem | Package | Affected | Fixed in |
|---|---|---|---|
| composer | twig/twig | < 3.26.0 | 3.26.0 |
Affected products
| Vendor | Product | Affected versions |
|---|---|---|
| Symfony | Twig | before 3.26.0 |
Weakness classification
References
- NVD record
- CVE.org record
- GitHub advisory
- https://github.com/advisories/GHSA-7fxw-r6jv-74c8
- https://github.com/twigphp/Twig/security/advisories/GHSA-7fxw-r6jv-74c8
- https://github.com/FriendsOfPHP/security-advisories/blob/master/twig/twig/CVE-2026-46638.yaml
- https://github.com/advisories/GHSA-6j75-5wfj-gh66
- https://symfony.com/cve-2026-46638
- https://github.com/twigphp/Twig/commit/819c6a89fe0f261b8555c4f4d5e27d31984223ea
- https://github.com/twigphp/Twig/releases/tag/v3.26.0