CVE-2026-46637: CWE-116: Improper Encoding or Escaping of Output in twigphp Twig
Twig before version 3.26.0 improperly marks several filters in twig/markdown-extra and twig/cssinliner-extra as safe for all output contexts, including HTML, JavaScript, CSS, and URLs, without proper escaping. This can lead to improper encoding or escaping of output, potentially causing security issues. The vulnerability is fixed in version 3.26.0.
AI Analysis
Technical Summary
CVE-2026-46637 describes a vulnerability in the Twig template engine for PHP where filters in the twig/markdown-extra and twig/cssinliner-extra extensions were registered with is_safe => [all]. This caused Twig to treat output as safe across multiple contexts (HTML, JavaScript, CSS, URL) without proper escaping, leading to CWE-116: Improper Encoding or Escaping of Output. The issue affects versions prior to 3.26.0 and was resolved by correcting the safety declarations in version 3.26.0.
Potential Impact
The vulnerability may allow unescaped or improperly escaped output in various contexts, which can lead to injection issues such as cross-site scripting (XSS) if user input is rendered through these filters. The CVSS 4.0 score of 5.1 indicates a medium severity with network attack vector, low complexity, and limited privileges required. No known exploits in the wild have been reported.
Mitigation Recommendations
Upgrade Twig to version 3.26.0 or later, where the issue is fixed. No other official remediation or temporary fixes are documented. Patch status is confirmed by the vendor advisory stating the fix is included in 3.26.0.
CVE-2026-46637: CWE-116: Improper Encoding or Escaping of Output in twigphp Twig
Description
Twig before version 3.26.0 improperly marks several filters in twig/markdown-extra and twig/cssinliner-extra as safe for all output contexts, including HTML, JavaScript, CSS, and URLs, without proper escaping. This can lead to improper encoding or escaping of output, potentially causing security issues. The vulnerability is fixed in version 3.26.0.
CVSS v4.0
Score 5.1medium
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-46637 describes a vulnerability in the Twig template engine for PHP where filters in the twig/markdown-extra and twig/cssinliner-extra extensions were registered with is_safe => [all]. This caused Twig to treat output as safe across multiple contexts (HTML, JavaScript, CSS, URL) without proper escaping, leading to CWE-116: Improper Encoding or Escaping of Output. The issue affects versions prior to 3.26.0 and was resolved by correcting the safety declarations in version 3.26.0.
Potential Impact
The vulnerability may allow unescaped or improperly escaped output in various contexts, which can lead to injection issues such as cross-site scripting (XSS) if user input is rendered through these filters. The CVSS 4.0 score of 5.1 indicates a medium severity with network attack vector, low complexity, and limited privileges required. No known exploits in the wild have been reported.
Mitigation Recommendations
Upgrade Twig to version 3.26.0 or later, where the issue is fixed. No other official remediation or temporary fixes are documented. Patch status is confirmed by the vendor advisory stating the fix is included in 3.26.0.
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: 6a56aea268715ace4342b0fc
Added to database: 07/14/2026, 21:48:18 UTC
Last enriched: 07/22/2026, 22:59:25 UTC
Last updated: 08/25/2026, 22:52:11 UTC
Views: 76
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.