Skip to main content
Press slash or control plus K to focus the search. Use the arrow keys to navigate results and press enter to open a threat.
Reconnecting to live updates…

CVE-2026-46628: CWE-116: Improper Encoding or Escaping of Output in twigphp Twig

0
Medium
VulnerabilityCVE-2026-46628cvecve-2026-46628cwe-116
Published: 07/14/2026 (07/14/2026, 21:19:54 UTC)
Source: CVE Database V5
Vendor/Project: twigphp
Product: 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

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
Low
User Interaction
Passive
Vuln. Confidentiality
None
Vuln. Integrity
None
Vuln. Availability
None
Subsq. Confidentiality
Low
Subsq. Integrity
Low
Subsq. Availability
None
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

Affected software

Packagistmore threats →ai
twig/twig
pkg:composer/twig/twig
Affected versions
<3.26.0

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

AILast updated: 07/14/2026, 22:24:30 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses