CVE-2026-46634: CWE-693: Protection Mechanism Failure in twigphp Twig
Twig versions from 3.9.0 up to but not including 3.26.0 have a protection mechanism failure in the template_from_string() function. This function compiles inner templates under synthesized names that can bypass sandbox security policies, allowing sandboxed templates to render inner templates without enforcement of security restrictions. The issue is fixed in version 3.26.0.
AI Analysis
Technical Summary
CVE-2026-46634 describes a vulnerability in twigphp's Twig template engine where the template_from_string() function, present in versions 3.9.0 through 3.25.x, compiles inner templates under synthesized names that may fall outside the scope of the SourcePolicyInterface sandbox. This allows a sandboxed template that can call template_from_string and include to render an inner template without the sandbox's security policy being applied, constituting a protection mechanism failure (CWE-693). The vulnerability is addressed in Twig version 3.26.0.
Potential Impact
An attacker able to execute sandboxed templates could bypass sandbox restrictions and render inner templates without security policy enforcement, potentially leading to unauthorized code execution or information disclosure within the sandboxed environment. The CVSS 4.0 score of 7.7 (high severity) reflects the network attack vector, low attack complexity, partial privileges required, no user interaction, and high impacts on confidentiality, integrity, and availability.
Mitigation Recommendations
This vulnerability is fixed in Twig version 3.26.0. Users should upgrade to version 3.26.0 or later to remediate this issue. No official patch or temporary fix is indicated other than upgrading. Since this is not a cloud service, remediation depends on user action to update the affected software.
CVE-2026-46634: CWE-693: Protection Mechanism Failure in twigphp Twig
Description
Twig versions from 3.9.0 up to but not including 3.26.0 have a protection mechanism failure in the template_from_string() function. This function compiles inner templates under synthesized names that can bypass sandbox security policies, allowing sandboxed templates to render inner templates without enforcement of security restrictions. The 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
CVE-2026-46634 describes a vulnerability in twigphp's Twig template engine where the template_from_string() function, present in versions 3.9.0 through 3.25.x, compiles inner templates under synthesized names that may fall outside the scope of the SourcePolicyInterface sandbox. This allows a sandboxed template that can call template_from_string and include to render an inner template without the sandbox's security policy being applied, constituting a protection mechanism failure (CWE-693). The vulnerability is addressed in Twig version 3.26.0.
Potential Impact
An attacker able to execute sandboxed templates could bypass sandbox restrictions and render inner templates without security policy enforcement, potentially leading to unauthorized code execution or information disclosure within the sandboxed environment. The CVSS 4.0 score of 7.7 (high severity) reflects the network attack vector, low attack complexity, partial privileges required, no user interaction, and high impacts on confidentiality, integrity, and availability.
Mitigation Recommendations
This vulnerability is fixed in Twig version 3.26.0. Users should upgrade to version 3.26.0 or later to remediate this issue. No official patch or temporary fix is indicated other than upgrading. Since this is not a cloud service, remediation depends on user action to update the affected software.
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/14/2026, 22:19:34 UTC
Last updated: 07/14/2026, 22:27:37 UTC
Views: 2
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.