CVE-2026-46637: CWE-116: Improper Encoding or Escaping of Output in twigphp Twig
Twig versions prior to 3.26.0 have a vulnerability where several filters in twig/markdown-extra and twig/cssinliner-extra are incorrectly registered as safe for all contexts, causing improper encoding or escaping of output. This can lead to unsafe output in HTML, JavaScript, CSS, URL, and other contexts. The issue is fixed in version 3.26.0.
AI Analysis
Technical Summary
CVE-2026-46637 describes an improper encoding or escaping vulnerability (CWE-116) in the Twig template engine for PHP. Specifically, before version 3.26.0, several filters in the twig/markdown-extra and twig/cssinliner-extra extensions are registered with is_safe => [all], which causes Twig to treat output as safe across multiple contexts without proper escaping. This can result in unsafe output rendering in HTML, JavaScript, CSS, URL, and other contexts. The vulnerability is addressed by correcting the safety registration in Twig 3.26.0.
Potential Impact
The vulnerability may allow unsafe output to be rendered in various contexts such as HTML, JavaScript, CSS, and URLs, potentially leading to injection issues or cross-site scripting (XSS) if untrusted input is processed through these filters. The CVSS 4.0 base score is 5.1 (medium severity), indicating a moderate risk with network attack vector, low complexity, and requiring low privileges and user interaction.
Mitigation Recommendations
Upgrade Twig to version 3.26.0 or later, where this issue is fixed. Since the vendor advisory confirms the fix in 3.26.0, applying this official patch is the recommended remediation. No other mitigation steps are specified.
CVE-2026-46637: CWE-116: Improper Encoding or Escaping of Output in twigphp Twig
Description
Twig versions prior to 3.26.0 have a vulnerability where several filters in twig/markdown-extra and twig/cssinliner-extra are incorrectly registered as safe for all contexts, causing improper encoding or escaping of output. This can lead to unsafe output in HTML, JavaScript, CSS, URL, and other contexts. The issue 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 an improper encoding or escaping vulnerability (CWE-116) in the Twig template engine for PHP. Specifically, before version 3.26.0, several filters in the twig/markdown-extra and twig/cssinliner-extra extensions are registered with is_safe => [all], which causes Twig to treat output as safe across multiple contexts without proper escaping. This can result in unsafe output rendering in HTML, JavaScript, CSS, URL, and other contexts. The vulnerability is addressed by correcting the safety registration in Twig 3.26.0.
Potential Impact
The vulnerability may allow unsafe output to be rendered in various contexts such as HTML, JavaScript, CSS, and URLs, potentially leading to injection issues or cross-site scripting (XSS) if untrusted input is processed through these filters. The CVSS 4.0 base score is 5.1 (medium severity), indicating a moderate risk with network attack vector, low complexity, and requiring low privileges and user interaction.
Mitigation Recommendations
Upgrade Twig to version 3.26.0 or later, where this issue is fixed. Since the vendor advisory confirms the fix in 3.26.0, applying this official patch is the recommended remediation. No other mitigation steps are specified.
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/14/2026, 22:24:09 UTC
Last updated: 07/14/2026, 22:27:34 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.