CVE-2026-49981: CWE-693: Protection Mechanism Failure in twigphp Twig
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.
AI Analysis
Technical Summary
CVE-2026-49981 describes a protection mechanism failure in twigphp Twig where the allow-list verdict for filters, tags, and functions is computed and cached at template construction time. Because this verdict can remain cached after changes to the sandbox policy between renders, a sandboxed render might reuse a template originally checked under a different or empty policy. This flaw affects Twig versions prior to 3.27.0 and was addressed by updating to version 3.27.0.
Potential Impact
The vulnerability could allow sandboxed template renders to bypass intended sandbox restrictions by reusing templates validated under different or empty policies. This undermines the sandbox's protection mechanism, potentially leading to unauthorized template behavior within sandboxed environments. No known exploits in the wild have been reported.
Mitigation Recommendations
Upgrade Twig to version 3.27.0 or later, where this issue is fixed. No other mitigations are specified. Patch status is not explicitly stated in the vendor advisory, but the fix is included in version 3.27.0.
CVE-2026-49981: CWE-693: Protection Mechanism Failure in twigphp Twig
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.
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 Twig where the allow-list verdict for filters, tags, and functions is computed and cached at template construction time. Because this verdict can remain cached after changes to the sandbox policy between renders, a sandboxed render might reuse a template originally checked under a different or empty policy. This flaw affects Twig versions prior to 3.27.0 and was addressed by updating to version 3.27.0.
Potential Impact
The vulnerability could allow sandboxed template renders to bypass intended sandbox restrictions by reusing templates validated under different or empty policies. This undermines the sandbox's protection mechanism, potentially leading to unauthorized template behavior within sandboxed environments. No known exploits in the wild have been reported.
Mitigation Recommendations
Upgrade Twig to version 3.27.0 or later, where this issue is fixed. No other mitigations are specified. Patch status is not explicitly stated in the vendor advisory, but the fix is included in version 3.27.0.
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/22/2026, 22:28:23 UTC
Last updated: 08/16/2026, 00:41:14 UTC
Views: 88
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.