CVE-2026-46628: CWE-116: Improper Encoding or Escaping of Output in twigphp Twig
Twig, a PHP template language, had a vulnerability prior to version 3.26.0 where the deprecated spaceless filter was incorrectly marked as safe for HTML. This caused Twig's autoescaping mechanism to output attacker-controlled markup without escaping when spaceless was applied to untrusted input. The issue is fixed in version 3.26.0.
AI Analysis
Technical Summary
CVE-2026-46628 describes an improper encoding or escaping of output vulnerability (CWE-116) in twigphp Twig. Specifically, before version 3.26.0, the deprecated spaceless filter was registered as safe for HTML, which caused Twig's autoescaping to bypass escaping for attacker-controlled input when the spaceless filter was used. This could lead to injection of unescaped markup in rendered templates. The vulnerability was addressed and fixed in Twig version 3.26.0.
Potential Impact
The vulnerability allows attacker-controlled input to be output without proper escaping when using the spaceless filter, potentially enabling injection of malicious HTML or scripts in rendered templates. This can lead to cross-site scripting (XSS) or other injection-based attacks depending on the context in which Twig templates are used. The CVSS 4.0 score is 5.1 (medium severity), indicating a moderate risk with network attack vector, low complexity, and no privileges required.
Mitigation Recommendations
Upgrade Twig to version 3.26.0 or later, where this issue is fixed. There is no indication of alternative mitigations or temporary fixes. Since this is not a cloud service, patching the affected software version is required to remediate the vulnerability.
CVE-2026-46628: CWE-116: Improper Encoding or Escaping of Output in twigphp Twig
Description
Twig, a PHP template language, had a vulnerability prior to version 3.26.0 where the deprecated spaceless filter was incorrectly marked as safe for HTML. This caused Twig's autoescaping mechanism to output attacker-controlled markup without escaping when spaceless was applied to untrusted input. 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-46628 describes an improper encoding or escaping of output vulnerability (CWE-116) in twigphp Twig. Specifically, before version 3.26.0, the deprecated spaceless filter was registered as safe for HTML, which caused Twig's autoescaping to bypass escaping for attacker-controlled input when the spaceless filter was used. This could lead to injection of unescaped markup in rendered templates. The vulnerability was addressed and fixed in Twig version 3.26.0.
Potential Impact
The vulnerability allows attacker-controlled input to be output without proper escaping when using the spaceless filter, potentially enabling injection of malicious HTML or scripts in rendered templates. This can lead to cross-site scripting (XSS) or other injection-based attacks depending on the context in which Twig templates are used. The CVSS 4.0 score is 5.1 (medium severity), indicating a moderate risk with network attack vector, low complexity, and no privileges required.
Mitigation Recommendations
Upgrade Twig to version 3.26.0 or later, where this issue is fixed. There is no indication of alternative mitigations or temporary fixes. Since this is not a cloud service, patching the affected software version is required to remediate the vulnerability.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-05-15T19:34:14.013Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 6a56aea068715ace4342b0d1
Added to database: 07/14/2026, 21:48:16 UTC
Last enriched: 07/14/2026, 22:24:30 UTC
Last updated: 07/15/2026, 03:02:13 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.