Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconSubmit crafted input
-
DeliveryApplication stores in comment node
-
ExploitSerialize DOM without requireWellFormed flag
-
InstallInject --> sequence terminates comment
-
C2Downstream parser interprets injected elements
-
ExecuteAlter XML document structure
-
ImpactExploit context-dependent impact
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization XPath query parameterization
|
| Exploitation Conditions | Exploitation requires application code that (1) accepts attacker-controlled input into XML comment nodes via createComment(), appendData(), insertData(), replaceData(), direct assignment to comment.data, or assignment to comment.textContent, AND (2) serializes the resulting DOM using XMLSerializer.serializeToString() without passing the { requireWellFormed: true } option (default behavior per W3C spec is verbatim serialization), AND (3) the serialized XML reaches a downstream consumer (parser, validator, signature verifier, policy engine, configuration loader) where injected elements carry semantic consequences-such as authentication bypass, privilege escalation, data exfiltration, or logic corruption. Limiting factors: Applications that only use xmldom for read-only parsing of trusted XML or that never expose serialized output to downstream systems are not exploitable. Applications already passing { requireWellFormed: true } to serializeToString() on versions 0.8.13+ or 0.9.10+ are protected. The vulnerability affects default configurations of @xmldom/xmldom but requires specific application-level integration of untrusted data into comments and meaningful downstream consumption of serialized output. |
| Impact | Real-world risk is HIGH for applications that serialize user-controlled comment content and hand the resulting XML to downstream consumers. CVSS:4.0 vector (AV:N/AC:L/PR:N/UI:N) confirms remote unauthenticated exploitation with low complexity, but the VI:H (high integrity impact) applies specifically to XML document structure, not code execution. Public exploit code exists via GitHub PR #987, demonstrating trivial reproduction (5 lines of JavaScript). However, exploitation requires two preconditions: (1) application must accept untrusted input into comment nodes, and (2) serialized output must reach a context where injected elements carry consequences-not all uses of xmldom meet both criteria. Vendor patches (0.8.13 and 0.9.10) are available but protection is OPT-IN via { requireWellFormed: true } flag, meaning existing deployments remain vulnerable until code is explicitly updated to pass this option at every serializeToString() call site. CRITICAL GAP: patch operates at serialization time only; no creation-time validation prevents malicious comment nodes from persisting in the DOM until serialization. Applications using default serialization settings (W3C spec-compliant verbatim mode) will continue emitting injectable output. Priority depends on deployment context: XML-signature workflows, SAML processors, configuration generators, and B2B XML messaging systems face CRITICAL risk; general-purpose DOM manipulation with no untrusted input or no downstream parsing faces LOW risk. The opt-in nature of the fix creates a long tail of vulnerable deployments. |
| Exploit ScenarioDerived | An attacker submits user-generated content (forum post, CMS entry, API parameter) to a Node.js application that stores metadata in XML comments. The application calls doc.createComment(req.body.userInput) where userInput contains '--><config><admin>true</admin></config><!--'. When the application serializes the document with new XMLSerializer().serializeToString(doc), the output becomes <root><!----><config><admin>true</admin></config><!----></root>. A downstream service (SAML consumer, policy engine, signed document validator) parses this XML and interprets the injected <config><admin>true</admin></config> element as legitimate structure, granting admin privileges or altering application logic. Public PoC exists demonstrating injection, reparsing, and element extraction via getElementsByTagName(). |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – May 07, 2026
XML node injection in the @xmldom/xmldom npm package allows remote attackers to inject arbitrary XML elements via maliciously crafted comment content containing the sequence '-->' which prematurely terminates comments during serialization. Applications processing untrusted input through createComment() or manipulating comment node data can emit structurally altered XML that downstream consumers parse as attacker-controlled elements. Public exploit code exists (GitHub PR #987). CVSS:4.0 rates this 8.7 (High) with network vector, low complexity, and no privileges required. Vendor-released patches require opt-in protection flag { requireWellFormed: true } to maintain backward compatibility with W3C spec defaults; existing code remains vulnerable unless explicitly migrated.
Earlier versions of this analysis (1)
XML comment injection in @xmldom/xmldom allows attackers to break out of comment boundaries and inject arbitrary XML elements into serialized documents. When attacker-controlled data is passed to createComment() and then serialized, the package fails to neutralize the comment-closing sequence (-->), enabling structural modification of generated XML. This affects applications building XML from untrusted input, particularly those handling configuration files, policy documents, or signed messages where downstream consumers trust document structure. Vendor-released patches (0.8.13 LTS and 0.9.10+) provide opt-in mitigation via requireWellFormed flag, but default behavior remains vulnerable for backward compatibility. Public exploit code exists via the original disclosure pull request.
RemediationAI
Upgrade to @xmldom/xmldom version 0.8.13 (for 0.8.x LTS users) or 0.9.10 (for 0.9.x users) as documented in release notes at https://github.com/xmldom/xmldom/releases/tag/0.8.13 and https://github.com/xmldom/xmldom/releases/tag/0.9.10. CRITICAL STEP: Audit all serializeToString() call sites in application code and pass { requireWellFormed: true } as the second argument-protection is not automatic and default behavior remains vulnerable for backward compatibility with W3C DOM Parsing spec section 3.2.1.4. Example: new XMLSerializer().serializeToString(doc, { requireWellFormed: true }). This triggers InvalidStateError before emitting malformed comments, preventing injection. On 0.9.x the check enforces full W3C constraints (throws on any '--' substring, trailing '-', or non-XML-Char characters). On 0.8.x LTS the check is narrowed to only the injection sequence '-->' to preserve round-trip compatibility with existing 0.8.x parser behavior that accepts bare '--' in comments. SIDE EFFECT: Enabling requireWellFormed will cause runtime exceptions if existing code legitimately creates comments containing '--' sequences-applications must handle InvalidStateError or sanitize comment content before creation. For users of the deprecated xmldom package (no fix available): migrate to @xmldom/xmldom 0.8.13+ or implement application-layer sanitization by replacing /--/g with '--' before calling createComment() or mutating comment.data. If migration is blocked, enforce least-privilege input validation: reject or escape comment content from untrusted sources, or switch to text nodes with proper escaping. Related commits: https://github.com/xmldom/xmldom/commit/b397540889086da868c30c366ad5c220d1a750c7 and https://github.com/xmldom/xmldom/commit/fda7cc313de30243fea35cada64e0bb12099c2a1.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 4 packages in npm, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The vulnerability resides in the XML serialization implementation of the @xmldom/xmldom JavaScript library, specifically in the XMLSerializer class that converts DOM trees to XML text. The affected packages (pkg:npm/@xmldom_xmldom and legacy pkg:npm/xmldom) implement W3C DOM Parsing and Serialization standards for Node.js environments. CWE-91 (XML Injection) occurs because the serializer concatenates comment node data directly between XML comment delimiters (<!-- and -->) without neutralizing comment-terminating sequences. While the serializer correctly escapes text nodes and rewrites unsafe CDATA terminators, comment nodes receive no equivalent context-sensitive encoding. When attacker-controlled data containing '-->' reaches the serialization path via createComment(), appendData(), insertData(), replaceData(), or direct assignment to .data or .textContent properties, the serializer emits syntactically valid but structurally compromised XML where content after the injected terminator is parsed as live markup rather than comment text. This class of injection affects any XML-processing workflow where document structure carries semantic weight-configuration files, SAML assertions, signed documents, policy engines, or message formats consumed by downstream XML parsers.
Know when Mozilla gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Primary rating from Vendor (https://github.com/xmldom/xmldom).
CVSS VectorVendor: https://github.com/xmldom/xmldom
Lifecycle Timeline
4DescriptionCVE.org
Summary
The package allows attacker-controlled comment content to be serialized into XML without validating or neutralizing comment breaking sequences. As a result, an attacker can terminate the comment early and inject arbitrary XML nodes into the serialized output.
---
Details
The issue is in the DOM construction and serialization flow for comment nodes.
When createComment(data) is called, the supplied string is stored as comment data through the generic character-data handling path. That content is kept as-is. Later, when the document is serialized, the serializer writes comment nodes by concatenating the XML comment delimiters with the stored node.data value directly.
That behavior is unsafe because XML comments are a syntax-sensitive context. If attacker-controlled input contains a sequence that closes the comment, the serializer does not preserve it as literal comment text. Instead, it emits output where the remainder of the payload is treated as live XML markup.
This is a real injection bug, not a formatting issue. The serializer already applies context-aware handling in other places, such as escaping text nodes and rewriting unsafe CDATA terminators. Comment content does not receive equivalent treatment. Because of that gap, untrusted data can break out of the comment boundary and modify the structure of the final XML document.
---
PoC
const { DOMImplementation, DOMParser, XMLSerializer } = require('@xmldom/xmldom');
const doc = new DOMImplementation().createDocument(null, 'root', null);
doc.documentElement.appendChild(
doc.createComment('--><injected attr="1"/><!--')
);
const xml = new XMLSerializer().serializeToString(doc);
console.log(xml);
// <root><!----><injected attr="1"/><!----></root>
const reparsed = new DOMParser().parseFromString(xml, 'text/xml');
console.log(reparsed.documentElement.childNodes.item(1).nodeName);
// injected---
Impact
An application that uses the package to build XML from untrusted input can be made to emit attacker-controlled elements outside the intended comment boundary. That allows the attacker to alter the meaning and structure of generated XML documents.
In practice, this can affect any workflow that generates XML and then stores it, forwards it, signs it, or hands it to another parser. Realistic targets include XML-based configuration, policy documents, and message formats where downstream consumers trust the serialized structure.
---
Disclosure
This vulnerability was publicly disclosed at 2026-04-06T11:25:07Z via xmldom/xmldom#987, which was subsequently closed without being merged.
---
Fix Applied
> ⚠ Opt-in required. Protection is not automatic. Existing serialization calls remain > vulnerable unless { requireWellFormed: true } is explicitly passed. Applications that pass > untrusted data to createComment() or mutate comment nodes with untrusted input (via > appendData, insertData, replaceData, .data =, or .textContent =) should audit all > serializeToString() call sites and add the option.
XMLSerializer.serializeToString() now accepts an options object as a second argument. When { requireWellFormed: true } is passed, the serializer throws InvalidStateError before emitting a Comment node whose .data would produce malformed XML.
On @xmldom/xmldom ≥ 0.9.10, the full W3C DOM Parsing §3.2.1.4 check is applied: throws if .data contains -- anywhere, ends with -, or contains characters outside the XML Char production.
On @xmldom/xmldom ≥ 0.8.13 (LTS), only the --> injection sequence is checked. The 0.8.x SAX parser accepts comments containing -- (without >), so throwing on bare -- would break a previously-working round-trip on that branch. The --> check is sufficient to prevent injection.
PoC - fixed path
const { DOMImplementation, XMLSerializer } = require('@xmldom/xmldom');
const doc = new DOMImplementation().createDocument(null, 'root', null);
doc.documentElement.appendChild(doc.createComment('--><injected attr="1"/><!--'));
// Default (unchanged): verbatim - injection present
const unsafe = new XMLSerializer().serializeToString(doc);
console.log(unsafe);
// <root><!----><injected attr="1"/><!----></root>
// Opt-in guard: throws InvalidStateError before serializing
try {
new XMLSerializer().serializeToString(doc, { requireWellFormed: true });
} catch (e) {
console.log(e.name, e.message);
// InvalidStateError: The comment node data contains "--" or ends with "-" (0.9.x)
// InvalidStateError: The comment node data contains "-->" (0.8.x - only --> is checked)
}Why the default stays verbatim
The W3C DOM Parsing and Serialization spec §3.2.1.4 defines a require well-formed flag whose default value is false. With the flag unset, the spec explicitly permits serializing ill-formed comment content verbatim - this is also the behavior of browser implementations (Chrome, Firefox, Safari): new XMLSerializer().serializeToString(doc) produces the injection sequence without error in all major browsers.
Unconditionally throwing would be a behavioral breaking change with no spec justification. The opt-in requireWellFormed: true flag allows applications that require injection safety to enable strict mode without breaking existing deployments.
Residual limitation
The fix operates at serialization time only. There is no creation-time check in createComment - the spec does not require one for comment data. Any path that leads to a Comment node with -- in its data (createComment, appendData, .data =, etc.) produces a node that serializes safely only when { requireWellFormed: true } is passed to serializeToString.
Blast Radius
ecosystem impact- 4 npm packages depend on @xmldom/xmldom (4 direct, 0 indirect)
- 2,019 npm packages depend on xmldom (864 direct, 1,181 indirect)
Ecosystem-wide dependent count for version 0.9.0 and other introduced versions.
Executive ViewAI
The @xmldom/xmldom npm package contains a critical XML comment injection vulnerability (CVE-2026-41672) that allows unauthenticated remote attackers to inject malicious XML elements into processed documents, potentially leading to XML injection attacks, data exfiltration, or downstream application compromise. Organizations using this package to process untrusted input face immediate risk of structural XML manipulation that could bypass security controls or trigger unintended application behavior.
Apply vendor patch and implement requireWellFormed:true flag. If upgrade cannot be completed immediately: implement input validation to reject XML comments containing '-->' sequences; isolate @xmldom/xmldom processing to sandboxed environments with limited network access; apply network-level restrictions on data exfiltration from systems processing untrusted XML input.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.
The PDF reader in Mozilla Firefox before 39.0.3, Firefox ESR 38.x before 38.1.1, and Firefox OS before 2.2 allows remote
Mozilla Firefox before 22.0, Firefox ESR 17.x before 17.0.7, Thunderbird before 17.0.7, and Thunderbird ESR 17.x before
Mozilla Firefox before 18.0, Firefox ESR 10.x before 10.0.12 and 17.x before 17.0.2, Thunderbird before 17.0.2, Thunderb
Use-after-free vulnerability in the serializeToStream implementation in the XMLSerializer component in Mozilla Firefox b
The Chrome Object Wrapper (COW) implementation in Mozilla Firefox before 16.0, Firefox ESR 10.x before 10.0.8, Thunderbi
The crypto.generateCRMFRequest function in Mozilla Firefox before 23.0, Firefox ESR 17.x before 17.0.8, Thunderbird befo
An issue was discovered in the Cisco WebEx Extension before 1.0.7 on Google Chrome, the ActiveTouch General Plugin Conta
The XrayWrapper implementation in Mozilla Firefox before 35.0 and SeaMonkey before 2.32 does not properly interact with
The Chrome Object Wrapper (COW) implementation in Mozilla Firefox before 18.0, Firefox ESR 17.x before 17.0.2, Thunderbi
The Web IDL implementation in Mozilla Firefox before 28.0, Firefox ESR 24.x before 24.4, Thunderbird before 24.4, and Se
Mozilla Firefox before 28.0, Firefox ESR 24.x before 24.4, Thunderbird before 24.4, and SeaMonkey before 2.25 allow remo
The Firefox sandbox in Adobe Flash Player before 10.3.183.67 and 11.x before 11.6.602.171 on Windows and Mac OS X, and b
Same weakness CWE-91 – XML Injection (aka Blind XPath Injection)
View allSame technique Information Disclosure
View allVendor StatusVendor
SUSE
Severity: High| Product | Status |
|---|---|
| SUSE Linux Enterprise Desktop 15 SP7 | Fixed |
| SUSE Linux Enterprise High Performance Computing 15 SP7 | Fixed |
| SUSE Linux Enterprise Module for Python 3 15 SP7 | Fixed |
| SUSE Linux Enterprise Server 15 SP7 | Fixed |
| SUSE Linux Enterprise Server for SAP Applications 15 SP7 | Fixed |
| SUSE Linux Enterprise High Performance Computing 15 SP4 | Fixed |
| SUSE Linux Enterprise High Performance Computing 15 SP4-LTSS | Fixed |
| SUSE Linux Enterprise High Performance Computing 15 SP5 | Fixed |
| SUSE Linux Enterprise High Performance Computing 15 SP5-LTSS | Fixed |
| SUSE Linux Enterprise Module for Python 3 15 SP6 | Fixed |
| SUSE Linux Enterprise Module for Server Applications 15 SP4 | Fixed |
| SUSE Linux Enterprise Module for Server Applications 15 SP5 | Fixed |
| SUSE Linux Enterprise Server 15 SP4 | Fixed |
| SUSE Linux Enterprise Server 15 SP4-LTSS | Fixed |
| SUSE Linux Enterprise Server 15 SP5 | Fixed |
| SUSE Linux Enterprise Server 15 SP5-LTSS | Fixed |
| SUSE Linux Enterprise Server 15 SP6 | Fixed |
| SUSE Linux Enterprise Server 15 SP6-LTSS | Fixed |
| SUSE Linux Enterprise Server for SAP Applications 15 SP6 | Fixed |
| SUSE Manager Proxy 4.3 | Fixed |
| SUSE Manager Proxy LTS 4.3 | Fixed |
| SUSE Manager Retail Branch Server 4.3 | Fixed |
| SUSE Manager Retail Branch Server LTS 4.3 | Fixed |
| SUSE Manager Server 4.3 | Fixed |
| SUSE Manager Server LTS 4.3 | Fixed |
| SUSE CaaS Platform 4.0 | Fixed |
| SUSE Enterprise Storage 6 | Fixed |
| SUSE Enterprise Storage 7 | Fixed |
| SUSE Enterprise Storage 7.1 | Fixed |
| SUSE Linux Enterprise Desktop 15 SP6 | Fixed |
| SUSE Linux Enterprise High Performance Computing 15 SP1 | Fixed |
| SUSE Linux Enterprise High Performance Computing 15 SP1-ESPOS | Fixed |
| SUSE Linux Enterprise High Performance Computing 15 SP1-LTSS | Fixed |
| SUSE Linux Enterprise High Performance Computing 15 SP2 | Fixed |
| SUSE Linux Enterprise High Performance Computing 15 SP2-ESPOS | Fixed |
| SUSE Linux Enterprise High Performance Computing 15 SP2-LTSS | Fixed |
| SUSE Linux Enterprise High Performance Computing 15 SP3 | Fixed |
| SUSE Linux Enterprise High Performance Computing 15 SP3-ESPOS | Fixed |
| SUSE Linux Enterprise High Performance Computing 15 SP3-LTSS | Fixed |
| SUSE Linux Enterprise High Performance Computing 15 SP4-ESPOS | Fixed |
| SUSE Linux Enterprise High Performance Computing 15 SP5-ESPOS | Fixed |
| SUSE Linux Enterprise High Performance Computing 15 SP6 | Fixed |
| SUSE Linux Enterprise Module for Server Applications 15 SP1 | Fixed |
| SUSE Linux Enterprise Module for Server Applications 15 SP2 | Fixed |
| SUSE Linux Enterprise Module for Server Applications 15 SP3 | Fixed |
| SUSE Linux Enterprise Real Time 15 SP2 | Fixed |
| SUSE Linux Enterprise Real Time 15 SP3 | Fixed |
| SUSE Linux Enterprise Real Time 15 SP4 | Fixed |
| SUSE Linux Enterprise Server 15 SP1 | Fixed |
| SUSE Linux Enterprise Server 15 SP1-BCL | Fixed |
| SUSE Linux Enterprise Server 15 SP1-LTSS | Fixed |
| SUSE Linux Enterprise Server 15 SP2 | Fixed |
| SUSE Linux Enterprise Server 15 SP2-BCL | Fixed |
| SUSE Linux Enterprise Server 15 SP2-LTSS | Fixed |
| SUSE Linux Enterprise Server 15 SP3 | Fixed |
| SUSE Linux Enterprise Server 15 SP3-BCL | Fixed |
| SUSE Linux Enterprise Server 15 SP3-LTSS | Fixed |
| SUSE Linux Enterprise Server for SAP Applications 15 SP1 | Fixed |
| SUSE Linux Enterprise Server for SAP Applications 15 SP2 | Fixed |
| SUSE Linux Enterprise Server for SAP Applications 15 SP3 | Fixed |
| SUSE Linux Enterprise Server for SAP Applications 15 SP4 | Fixed |
| SUSE Linux Enterprise Server for SAP Applications 15 SP5 | Fixed |
| SUSE Manager Proxy 4.0 | Fixed |
| SUSE Manager Proxy 4.1 | Fixed |
| SUSE Manager Proxy 4.2 | Fixed |
| SUSE Manager Retail Branch Server 4.0 | Fixed |
| SUSE Manager Retail Branch Server 4.1 | Fixed |
| SUSE Manager Retail Branch Server 4.2 | Fixed |
| SUSE Manager Server 4.0 | Fixed |
| SUSE Manager Server 4.1 | Fixed |
| SUSE Manager Server 4.2 | Fixed |
| openSUSE Leap 15.3 | Fixed |
| openSUSE Leap 15.4 | Fixed |
| openSUSE Leap 15.5 | Fixed |
EUVD-2026-28285
GHSA-j759-j44w-7fr8
NVD
CVE.org
EPSS
Exploit-DB