CVE-2026-41674: xmldom: XML injection through unvalidated DocumentType serialization
xmldom is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) `DOMParser` and `XMLSerializer` module. In @xmldom/xmldom prior to versions 0.9.10 and 0.8.13 and xmldom version 0.6.0 and prior, the package serializes DocumentType node fields (internalSubset, publicId, systemId) verbatim without any escaping or validation. When these fields are set programmatically to attacker-controlled strings, XMLSerializer.serializeToString can produce output where the DOCTYPE declaration is terminated early and arbitrary markup appears outside it. This issue has been patched in versions @xmldom/xmldom versions 0.9.10 and 0.8.13.
Security readout for executives and security teams
Plain-English summary
Affected xmldom applications can produce manipulated XML when untrusted data reaches document-type fields. An attacker may break out of the DOCTYPE declaration and insert arbitrary markup, potentially corrupting documents or changing how downstream systems interpret them. Exposure depends on application data flow; merely installing the package does not establish exploitability.
Executive priority
Prioritize remediation for internet-facing services and workflows where serialized XML affects transactions, configuration, signatures, or trusted integrations. Patch promptly after compatibility testing. Systems that never construct DocumentType nodes from untrusted data have lower immediate exposure, but vulnerable dependencies should still be tracked and updated.
Technical view
Affected versions serialize DocumentType internalSubset, publicId, and systemId values without validation or escaping. Attacker-controlled values can terminate the DOCTYPE early, placing arbitrary markup outside it. The supplied CVSS v4.0 score is 8.7, emphasizing high integrity impact. Fixed @xmldom/xmldom releases are 0.8.13 and 0.9.10.
Likely exposure
Highest risk exists where applications programmatically populate DocumentType fields from network-originated or otherwise untrusted input, then serialize XML for storage, transmission, signing, or downstream processing. Affected dependencies include xmldom 0.6.0 and earlier and the specified vulnerable @xmldom/xmldom release lines, including transitive installations.
Exploitation context
The supplied vector describes network-accessible, low-complexity exploitation without privileges or user interaction. However, exploitation requires an application-specific path from attacker-controlled input into DocumentType fields followed by serialization. The source bundle does not identify active exploitation, and the CVE is not listed as KEV.
Researcher notes
CWE-91 applies because unvalidated DocumentType fields cross a syntax boundary during serialization. Assessment should distinguish package presence from a reachable sink: field assignment, attacker influence, serialization, and security-relevant consumption must align. The provided evidence supports arbitrary markup injection and high integrity impact, but does not establish confidentiality loss, availability impact, or exploitation in the wild.
Mitigation direction
Upgrade @xmldom/xmldom 0.8.x to 0.8.13 or later.
Upgrade @xmldom/xmldom 0.9.x to 0.9.10 or later.
For legacy xmldom, consult vendor guidance and move to a maintained fixed release.
Until upgraded, prevent untrusted values from populating DocumentType fields.
Review downstream XML workflows that rely on serialized document integrity.
Validation and detection
Inventory direct and transitive installations of xmldom and @xmldom/xmldom.
Confirm deployed lockfiles and runtime artifacts contain a fixed scoped-package version.
Trace data flow into internalSubset, publicId, and systemId assignments.
Verify serialized XML cannot escape the intended DOCTYPE boundary.
Run regression tests covering rejected or safely handled untrusted DocumentType values.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-91: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.