CVE-2026-49981: CWE-693: Protection Mechanism Failure in twigphp Twig
Twig, a PHP template language, has a protection mechanism failure vulnerability prior to version 3.27.0. The issue involves the caching of per-template allow-list verdicts for filters, tags, and functions, which can persist after sandbox state changes between renders. This allows a sandboxed render to reuse a template that was originally checked with a different or empty policy. The vulnerability is fixed in version 3.27.0.
AI Analysis
Technical Summary
CVE-2026-49981 describes a protection mechanism failure in twigphp's Twig template engine. Before version 3.27.0, the allow-list verdict for filters, tags, and functions is computed when a Template instance is constructed and cached. If the sandbox state changes between renders, this cached verdict may be reused incorrectly, allowing a sandboxed render to execute with an outdated or inappropriate policy. This issue was addressed and fixed in Twig version 3.27.0.
Potential Impact
The vulnerability allows a sandboxed render to reuse a template checked under a different or empty policy, potentially bypassing sandbox restrictions. This could lead to unauthorized execution of template code that should have been restricted. The CVSS 4.0 score is 6.0 (medium severity), indicating a moderate impact with network attack vector, low attack complexity, and partial privileges required.
Mitigation Recommendations
Upgrade Twig to version 3.27.0 or later, where this issue is fixed. No other mitigation is indicated or required according to the available data.
CVE-2026-49981: CWE-693: Protection Mechanism Failure in twigphp Twig
Description
Twig, a PHP template language, has a protection mechanism failure vulnerability prior to version 3.27.0. The issue involves the caching of per-template allow-list verdicts for filters, tags, and functions, which can persist after sandbox state changes between renders. This allows a sandboxed render to reuse a template that was originally checked with a different or empty policy. The vulnerability is fixed in version 3.27.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.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-49981 describes a protection mechanism failure in twigphp's Twig template engine. Before version 3.27.0, the allow-list verdict for filters, tags, and functions is computed when a Template instance is constructed and cached. If the sandbox state changes between renders, this cached verdict may be reused incorrectly, allowing a sandboxed render to execute with an outdated or inappropriate policy. This issue was addressed and fixed in Twig version 3.27.0.
Potential Impact
The vulnerability allows a sandboxed render to reuse a template checked under a different or empty policy, potentially bypassing sandbox restrictions. This could lead to unauthorized execution of template code that should have been restricted. The CVSS 4.0 score is 6.0 (medium severity), indicating a moderate impact with network attack vector, low attack complexity, and partial privileges required.
Mitigation Recommendations
Upgrade Twig to version 3.27.0 or later, where this issue is fixed. No other mitigation is indicated or required according to the available data.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-06-02T18:30:51.282Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a56aea568715ace4342b6f0
Added to database: 07/14/2026, 21:48:21 UTC
Last enriched: 07/14/2026, 22:09:12 UTC
Last updated: 07/14/2026, 22:09:12 UTC
Views: 4
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.