CVE-2026-46634: CWE-693: Protection Mechanism Failure in twigphp Twig
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.
AI Analysis
Technical Summary
The vulnerability in twigphp Twig (CVE-2026-46634) involves the template_from_string() function compiling inner templates under a synthesized name (__string_template__<hash>) that can fall outside the scope of the SourcePolicyInterface sandbox decision. This flaw permits sandboxed templates to call template_from_string and include functions to render inner templates without enforcing the sandbox security policy. The affected versions are from 3.9.0 up to but not including 3.26.0. The vulnerability is classified as CWE-693 (Protection Mechanism Failure) and carries a CVSS 4.0 score of 7.7, indicating high severity. The issue is resolved in version 3.26.0.
Potential Impact
An attacker able to execute sandboxed templates can bypass sandbox restrictions to render inner templates without security policy enforcement. This could lead to unauthorized code execution or exposure of sensitive data within the context of the Twig templating environment. The vulnerability affects confidentiality, integrity, and availability as indicated by the CVSS vector.
Mitigation Recommendations
Upgrade Twig to version 3.26.0 or later, where this vulnerability is fixed. There is no official patch or temporary workaround indicated. Until upgraded, avoid using untrusted input with template_from_string() in sandboxed environments.
CVE-2026-46634: CWE-693: Protection Mechanism Failure in twigphp Twig
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.
CVSS v4.0
Score 7.7high
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The vulnerability in twigphp Twig (CVE-2026-46634) involves the template_from_string() function compiling inner templates under a synthesized name (__string_template__<hash>) that can fall outside the scope of the SourcePolicyInterface sandbox decision. This flaw permits sandboxed templates to call template_from_string and include functions to render inner templates without enforcing the sandbox security policy. The affected versions are from 3.9.0 up to but not including 3.26.0. The vulnerability is classified as CWE-693 (Protection Mechanism Failure) and carries a CVSS 4.0 score of 7.7, indicating high severity. The issue is resolved in version 3.26.0.
Potential Impact
An attacker able to execute sandboxed templates can bypass sandbox restrictions to render inner templates without security policy enforcement. This could lead to unauthorized code execution or exposure of sensitive data within the context of the Twig templating environment. The vulnerability affects confidentiality, integrity, and availability as indicated by the CVSS vector.
Mitigation Recommendations
Upgrade Twig to version 3.26.0 or later, where this vulnerability is fixed. There is no official patch or temporary workaround indicated. Until upgraded, avoid using untrusted input with template_from_string() in sandboxed environments.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-15T20:11:54.583Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a56aea068715ace4342b0e1
Added to database: 07/14/2026, 21:48:16 UTC
Last enriched: 07/30/2026, 07:09:53 UTC
Last updated: 08/25/2026, 22:52:11 UTC
Views: 63
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.