CVE-2026-49981 Details
Description
Twig is a template language for PHP. Prior to 3.27.0, the per-template filter, tag, and function allow-list verdict is computed when a Template instance is constructed and can remain cached after sandbox state changes between renders, allowing a later sandboxed render to reuse a template that was originally checked with a different or empty policy. This issue is fixed in version 3.27.0.
A vulnerability exists in Twig, a template language for PHP, prior to version 3.27.0, allowing a bypass of the sandbox security policy. The issue arises because the security allow-list for filters, tags, and functions is determined when a template is first loaded and can be cached. This cached information may not reflect subsequent changes in the sandbox state, leading to a situation where a template can be reused in a sandboxed context without the appropriate security checks. The vulnerability is particularly concerning in environments that share a single Twig environment between different requests, such as with PHP-FPM or certain message queue consumers.
Users can upgrade to Twig version 3.27.0 or later, where this vulnerability has been fixed.
Metrics
CVSS 4.0 Severity and Vector Strings:
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Jul 21, 2026References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-693 | Protection Mechanism Failure | [email protected] |
| CWE-863 | Incorrect Authorization | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| symfony twig | < 3.27.0 |
CPE
Remediation
| |
Change History
3 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jul 21, 2026 | CVE Modified | CISA-ADP |
| Jul 17, 2026 | Initial Analysis | [email protected] |
| Jul 14, 2026 | New CVE Received | [email protected] |