CVE-2026-46638: CWE-693: Protection Mechanism Failure in twigphp Twig
Twig, a PHP template language, has a protection mechanism failure vulnerability prior to version 3.26.0. The issue involves the {% sandbox %}{% include %} tags allowing inclusion of templates loaded outside the sandbox without rechecking security policies. This can result in unauthorized use of tags, filters, and functions that should be denied by SecurityPolicy::checkSecurity(). The vulnerability is fixed in version 3.26.0.
AI Analysis
Technical Summary
CVE-2026-46638 describes a protection mechanism failure in twigphp's Twig template engine. Before version 3.26.0, the sandbox feature combined with the include tag could include a cached template previously loaded outside the sandbox without re-invoking the security policy check (SecurityPolicy::checkSecurity()). This flaw allows the cached template to execute tags, filters, and functions that the sandbox security policy should have denied, potentially bypassing intended security restrictions. The issue is resolved in Twig version 3.26.0.
Potential Impact
This vulnerability allows templates included within a sandbox context to bypass security policy checks if the template was previously loaded outside the sandbox. This can lead to unauthorized execution of restricted tags, filters, or functions within the sandbox, potentially compromising the intended security boundaries of template rendering. The CVSS 4.0 score of 6 indicates a medium severity with network attack vector, low attack complexity, and partial privileges required.
Mitigation Recommendations
Upgrade Twig to version 3.26.0 or later, where this vulnerability is fixed. Patch status is confirmed by the vendor advisory indicating the fix in 3.26.0. No other mitigations are specified or required.
CVE-2026-46638: CWE-693: Protection Mechanism Failure in twigphp Twig
Description
Twig, a PHP template language, has a protection mechanism failure vulnerability prior to version 3.26.0. The issue involves the {% sandbox %}{% include %} tags allowing inclusion of templates loaded outside the sandbox without rechecking security policies. This can result in unauthorized use of tags, filters, and functions that should be denied by SecurityPolicy::checkSecurity(). The vulnerability is fixed in version 3.26.0.
CVSS v4.0
Score 6.0medium
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-46638 describes a protection mechanism failure in twigphp's Twig template engine. Before version 3.26.0, the sandbox feature combined with the include tag could include a cached template previously loaded outside the sandbox without re-invoking the security policy check (SecurityPolicy::checkSecurity()). This flaw allows the cached template to execute tags, filters, and functions that the sandbox security policy should have denied, potentially bypassing intended security restrictions. The issue is resolved in Twig version 3.26.0.
Potential Impact
This vulnerability allows templates included within a sandbox context to bypass security policy checks if the template was previously loaded outside the sandbox. This can lead to unauthorized execution of restricted tags, filters, or functions within the sandbox, potentially compromising the intended security boundaries of template rendering. The CVSS 4.0 score of 6 indicates a medium severity with network attack vector, low attack complexity, and partial privileges required.
Mitigation Recommendations
Upgrade Twig to version 3.26.0 or later, where this vulnerability is fixed. Patch status is confirmed by the vendor advisory indicating the fix in 3.26.0. No other mitigations are specified or required.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-15T20:11:54.584Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a56aea268715ace4342b102
Added to database: 07/14/2026, 21:48:18 UTC
Last enriched: 07/14/2026, 22:24:03 UTC
Last updated: 07/14/2026, 22:27:33 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.