CVE-2026-34601
xmldom: XML injection via unsafe CDATA serialization allows attacker-controlled markup insertion
xmldom is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. In xmldom versions 0.6.0 and prior and @xmldom/xmldom prior to versions 0.8.12 and 0.9.9, xmldom/xmldom allows attacker-controlled strings containing the CDATA terminator ]]> to be inserted into a CDATASection node. During serialization, XMLSerializer emitted the CDATA content verbatim without rejecting or safely splitting the terminator. As a result, data intended to remain text-only became active XML markup in the serialized output, enabling XML structure injection and downstream business-logic manipulation. This issue has been patched in xmldom version 0.6.0 and @xmldom/xmldom versions 0.8.12 and 0.9.9.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- High
- Availability
- None
Exploit likelihood
What each source reports
CVE List Score used
7.5
xmldom: XML injection via unsafe CDATA serialization allows attacker-controlled markup insertion
xmldom is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. In xmldom versions 0.6.0 and prior and @xmldom/xmldom prior to versions 0.8.12 and 0.9.9, xmldom/xmldom allows attacker-controlled strings containing the CDATA terminator ]]> to be inserted into a CDATASection node. During serialization, XMLSerializer emitted the CDATA content verbatim without rejecting or safely splitting the terminator. As a result, data intended to remain text-only became active XML markup in the serialized output, enabling XML structure injection and downstream business-logic manipulation. This issue has been patched in xmldom version 0.6.0 and @xmldom/xmldom versions 0.8.12 and 0.9.9.
- Record
CVE-2026-34601- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-91, CWE-91
- Updated
- 2026-11-02
EUVDEUVD-2026-18460
7.5
xmldom is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. In xmldom versions 0.6.0 and prior and @xmldom/xmldom prior to versions 0.8.12 and 0.9.9, xmldom/xmldom allows attacker-controlled strings containing the CDATA terminator ]]> to be inserted into a CDATASection node. During serialization, XMLSerializer emitted the CDATA content verbatim without rejecting or safely splitting the terminator. As a result, data intended to remain text-only became active XML markup in the serialized output, enabling XML structure injection and downstream business-logic manipulation. This issue has been patched in xmldom version 0.6.0 and @xmldom/xmldom versions 0.8.12 and 0.9.9.
- Record
EUVD-2026-18460- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-wh4c-j3r5-mjhp
7.5
xmldom: XML injection via unsafe CDATA serialization allows attacker-controlled markup insertion
Summary
@xmldom/xmldom allows attacker-controlled strings containing the CDATA terminator ]]> to be inserted into a CDATASection node. During serialization, XMLSerializer emitted the CDATA content verbatim without rejecting or safely splitting the terminator. As a result, data intended to remain text-only became active XML markup in the serialized output, enabling XML structure
injection and downstream business-logic manipulation.
The sequence ]]> is not allowed inside CDATA content and must be rejected or safely handled during serialization. (MDN Web Docs)
Attack surface
Document.createCDATASection(data) is the most direct entry point, but it is not the only one. The WHATWG DOM spec intentionally does not validate ]]> in mutation methods — only createCDATASection carries that guard. The following paths therefore also allow ]]> to enter a CDATASection node and reach the serializer:
CharacterData.appendData()CharacterData.replaceData()CharacterData.insertData()- Direct assignment to
.data - Direct assignment to
.textContent
(Note: assigning to .nodeValue does not update .data in this implementation — the serializer reads .data directly — so .nodeValue is not an exploitable path.)
Parse path
Parsing XML that contains a CDATA section is not affected. The SAX parser's non-greedy CDSect regex stops at the first ]]>, so parsed CDATA data never contains the terminator.
Impact
If an application uses xmldom to generate "trusted" XML documents that embed untrusted user input inside CDATA (a common pattern in exports, feeds, SOAP/XML integrations, etc.), an attacker can inject additional XML elements/attributes into the generated document.
This can lead to:
- Integrity violation of generated XML documents.
- Business-logic injection in downstream consumers (e.g., injecting
<approved>true</approved>,<role>admin</role>, workflow flags, or other security-relevant elements). - Unexpected privilege/workflow decisions if downstream logic assumes injected nodes cannot appear.
This issue does not require malformed parsers or browser behavior; it is caused by serialization producing attacker-influenced XML markup.
Root Cause (with file + line numbers)
File: lib/dom.js
1. No validation in createCDATASection
createCDATASection: function (data) accepts any string and appends it directly.
- Lines 2216–2221 (0.9.8)
2. Unsafe CDATA serialization
Serializer prints CDATA sections as:
<![CDATA[ + node.data + ]]>
without handling ]]> in the data.
- Lines 2919–2920 (0.9.8)
Because CDATA content is emitted verbatim, an embedded ]]> closes the CDATA section early and the remainder of the attacker-controlled payload is interpreted as markup in the serialized XML.
Proof of Concept — Fix A: createCDATASection now throws
On patched versions, passing ]]> directly to createCDATASection throws InvalidCharacterError instead of silently accepting the payload:
const { DOMImplementation } = require('./lib');
const doc = new DOMImplementation().createDocument(null, 'root', null);
try {
doc.createCDATASection('SAFE]]><injected attr="pwn"/>');
console.log('VULNERABLE — no error thrown');
} catch (e) {
console.log('FIXED — threw:', e.name); // InvalidCharacterError
}
Expected output on patched versions:
FIXED — threw: InvalidCharacterError
Proof of Concept — Fix B: mutation vector now safe
On patched versions, injecting ]]> via a mutation method (appendData, replaceData, .data =, .textContent =) no longer produces injectable output. The serializer splits the terminator so the result round-trips as safe text:
const { DOMImplementation, XMLSerializer } = require('./lib');
const { DOMParser } = require('./lib');
const doc = new DOMImplementation().createDocument(null, 'root', null);
//…
- Record
GHSA-wh4c-j3r5-mjhp- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-91
- Updated
- 2026-11-02
NVD
7.5
xmldom is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. In xmldom versions 0.6.0 and prior and @xmldom/xmldom prior to versions 0.8.12 and 0.9.9, xmldom/xmldom allows attacker-controlled strings containing the CDATA terminator ]]> to be inserted into a CDATASection node. During serialization, XMLSerializer emitted the CDATA content verbatim without rejecting or safely splitting the terminator. As a result, data intended to remain text-only became active XML markup in the serialized output, enabling XML structure injection and downstream business-logic manipulation. This issue has been patched in xmldom version 0.6.0 and @xmldom/xmldom versions 0.8.12 and 0.9.9.
- Record
CVE-2026-34601- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-91
- Updated
- 2026-11-02
OSV
7.5
xmldom: XML injection via unsafe CDATA serialization allows attacker-controlled markup insertion
xmldom is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. In xmldom versions 0.6.0 and prior and @xmldom/xmldom prior to versions 0.8.12 and 0.9.9, xmldom/xmldom allows attacker-controlled strings containing the CDATA terminator ]]> to be inserted into a CDATASection node. During serialization, XMLSerializer emitted the CDATA content verbatim without rejecting or safely splitting the terminator. As a result, data intended to remain text-only became active XML markup in the serialized output, enabling XML structure injection and downstream business-logic manipulation. This issue has been patched in xmldom version 0.6.0 and @xmldom/xmldom versions 0.8.12 and 0.9.9.
- Record
CVE-2026-34601- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-91
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2026-34601
7.5
xmldom is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. In xmldom versions 0.6.0 and prior and @xmldom/xmldom prior to versions 0.8.12 and 0.9.9, xmldom/xmldom allows attacker-controlled strings containing the CDATA terminator ]]> to be inserted into a CDATASection node. During serialization, XMLSerializer emitted the CDATA content verbatim without rejecting or safely splitting the terminator. As a result, data intended to remain text-only became active XML markup in the serialized output, enabling XML structure injection and downstream business-logic manipulation. This issue has been patched in xmldom version 0.6.0 and @xmldom/xmldom versions 0.8.12 and 0.9.9.
- Record
DEBIAN-CVE-2026-34601- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Updated
- 2026-11-02
Show 8 moreShow less
OSVGHSA-wh4c-j3r5-mjhp
7.5
xmldom: XML injection via unsafe CDATA serialization allows attacker-controlled markup insertion
Summary
@xmldom/xmldom allows attacker-controlled strings containing the CDATA terminator ]]> to be inserted into a CDATASection node. During serialization, XMLSerializer emitted the CDATA content verbatim without rejecting or safely splitting the terminator. As a result, data intended to remain text-only became active XML markup in the serialized output, enabling XML structure
injection and downstream business-logic manipulation.
The sequence ]]> is not allowed inside CDATA content and must be rejected or safely handled during serialization. (MDN Web Docs)
Attack surface
Document.createCDATASection(data) is the most direct entry point, but it is not the only one. The WHATWG DOM spec intentionally does not validate ]]> in mutation methods — only createCDATASection carries that guard. The following paths therefore also allow ]]> to enter a CDATASection node and reach the serializer:
CharacterData.appendData()CharacterData.replaceData()CharacterData.insertData()- Direct assignment to
.data - Direct assignment to
.textContent
(Note: assigning to .nodeValue does not update .data in this implementation — the serializer reads .data directly — so .nodeValue is not an exploitable path.)
Parse path
Parsing XML that contains a CDATA section is not affected. The SAX parser's non-greedy CDSect regex stops at the first ]]>, so parsed CDATA data never contains the terminator.
Impact
If an application uses xmldom to generate "trusted" XML documents that embed untrusted user input inside CDATA (a common pattern in exports, feeds, SOAP/XML integrations, etc.), an attacker can inject additional XML elements/attributes into the generated document.
This can lead to:
- Integrity violation of generated XML documents.
- Business-logic injection in downstream consumers (e.g., injecting
<approved>true</approved>,<role>admin</role>, workflow flags, or other security-relevant elements). - Unexpected privilege/workflow decisions if downstream logic assumes injected nodes cannot appear.
This issue does not require malformed parsers or browser behavior; it is caused by serialization producing attacker-influenced XML markup.
Root Cause (with file + line numbers)
File: lib/dom.js
1. No validation in createCDATASection
createCDATASection: function (data) accepts any string and appends it directly.
- Lines 2216–2221 (0.9.8)
2. Unsafe CDATA serialization
Serializer prints CDATA sections as:
<![CDATA[ + node.data + ]]>
without handling ]]> in the data.
- Lines 2919–2920 (0.9.8)
Because CDATA content is emitted verbatim, an embedded ]]> closes the CDATA section early and the remainder of the attacker-controlled payload is interpreted as markup in the serialized XML.
Proof of Concept — Fix A: createCDATASection now throws
On patched versions, passing ]]> directly to createCDATASection throws InvalidCharacterError instead of silently accepting the payload:
const { DOMImplementation } = require('./lib');
const doc = new DOMImplementation().createDocument(null, 'root', null);
try {
doc.createCDATASection('SAFE]]><injected attr="pwn"/>');
console.log('VULNERABLE — no error thrown');
} catch (e) {
console.log('FIXED — threw:', e.name); // InvalidCharacterError
}
Expected output on patched versions:
FIXED — threw: InvalidCharacterError
Proof of Concept — Fix B: mutation vector now safe
On patched versions, injecting ]]> via a mutation method (appendData, replaceData, .data =, .textContent =) no longer produces injectable output. The serializer splits the terminator so the result round-trips as safe text:
const { DOMImplementation, XMLSerializer } = require('./lib');
const { DOMParser } = require('./lib');
const doc = new DOMImplementation().createDocument(null, 'root', null);
//…
- Record
GHSA-wh4c-j3r5-mjhp- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Weakness
- CWE-91
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2026-34601
7.5
xmldom is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. In xmldom versions 0.6.0 and prior and @xmldom/xmldom prior to versions 0.8.12 and 0.9.9, xmldom/xmldom allows attacker-controlled strings containing the CDATA terminator ]]> to be inserted into a CDATASection node. During serialization, XMLSerializer emitted the CDATA content verbatim without rejecting or safely splitting the terminator. As a result, data intended to remain text-only became active XML markup in the serialized output, enabling XML structure injection and downstream business-logic manipulation. This issue has been patched in xmldom version 0.6.0 and @xmldom/xmldom versions 0.8.12 and 0.9.9.
- Record
UBUNTU-CVE-2026-34601- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N - Updated
- 2026-11-02
OSVCLSA-2026-1778114662 No score
TuxCare security update for xmldom (3 CVEs)
TuxCare rebuilt xmldom to address 3 CVEs. Fixed in 0.6.0-tuxcare.2.
- Record
CLSA-2026-1778114662- Updated
- 2026-11-05
OSVCLSA-2026-1791987635 No score
TuxCare security update for @xmldom/xmldom (1 CVE)
TuxCare rebuilt @xmldom/xmldom to address 1 CVE. Fixed in 0.7.13-tuxcare.2.
- Record
CLSA-2026-1791987635- Updated
- 2026-11-02
OSVCLSA-2026-1791987856 No score
TuxCare security update for @xmldom/xmldom (4 CVEs)
TuxCare rebuilt @xmldom/xmldom to address 4 CVEs. Fixed in 0.9.8-tuxcare.5.
- Record
CLSA-2026-1791987856- Updated
- 2026-11-02
OSVopenSUSE-SU-2026:10497-1 No score
heroic-games-launcher-2.20.1-5.1 on GA media
These are all security issues fixed in the heroic-games-launcher-2.20.1-5.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2026:10497-1- Updated
- 2026-11-02
OSVopenSUSE-SU-2026:10506-1 No score
jupyter-jupyterlab-templates-0.5.3-1.1 on GA media
These are all security issues fixed in the jupyter-jupyterlab-templates-0.5.3-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2026:10506-1- Updated
- 2026-11-02
OSVROOT-APP-NPM-CVE-2026-34601 No score
CVE-2026-34601 in @xmldom/xmldom - Patched by Root
Root has patched CVE-2026-34601 in the @xmldom/xmldom package for Root:npm. Multiple fixed versions available.
- Record
ROOT-APP-NPM-CVE-2026-34601- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
xmldomnpm |
through 0.6.0 | None known |
@xmldom/xmldomnpm |
before 0.8.12 | 0.8.12 |
@xmldom/xmldomnpm |
0.9.0 up to 0.9.9 | 0.9.9 |
xmldomTuxCare:npm From an advisory covering 3 CVEs |
0.6.0-tuxcare.0 up to 0.6.0-tuxcare.2, plus listed versions 0.6.00.6.0-tuxcare.1 |
0.6.0-tuxcare.2 |
@xmldom/xmldomTuxCare:npm |
0.7.13-tuxcare.0 up to 0.7.13-tuxcare.2, plus listed versions 0.7.130.7.13-tuxcare.1 |
0.7.13-tuxcare.2 |
@xmldom/xmldomTuxCare:npm From an advisory covering 4 CVEs |
0.9.8-tuxcare.0 up to 0.9.8-tuxcare.5, plus listed versions 0.9.80.9.8-tuxcare.10.9.8-tuxcare.20.9.8-tuxcare.30.9.8-tuxcare.4 |
0.9.8-tuxcare.5 |
node-xmldomDebian:12 |
All versions, plus listed versions 0.8.6-10.9.10-10.9.10-20.9.11-10.9.12-1 Show 5 moreShow less0.9.5-10.9.6-10.9.8-10.9.8-20.9.9-1 |
None known |
node-xmldomDebian:13 |
All versions, plus listed versions 0.9.10-10.9.10-20.9.11-10.9.12-10.9.6-10.9.8-10.9.8-20.9.9-1 |
None known |
node-xmldomDebian:14 |
before 0.9.9-1, plus listed versions 0.9.6-10.9.8-10.9.8-2 |
0.9.9-1 |
@xmldom/xmldomRoot:npm |
before 0.7.13-aikido.2 | 0.7.13-aikido.20.7.13-aikido.30.9.8-aikido.20.8.11-aikido.20.7.13-aikido.50.7.13-aikido.4 |
Show 9 moreShow less
| Package | Affected | Fixed |
|---|---|---|
@rootio/xmldom__xmldomRoot:npm |
before 0.9.8-root.io.1 | 0.9.8-root.io.10.8.11-root.io.10.7.13-root.io.10.7.13-root.io.20.7.13-root.io.30.9.8-root.io.20.8.11-root.io.20.7.13-root.io.50.7.13-root.io.4 |
node-xmldomUbuntu:20.04:LTS |
All versions, plus listed versions 0.1.27+ds-10.1.27+ds-1+deb10u2build0.20.04.1 |
None known |
node-xmldomUbuntu:22.04:LTS |
All versions, plus listed versions 0.5.0-10.7.3-10.7.5-10.7.5-1ubuntu0.22.04.1 |
None known |
node-xmldomUbuntu:24.04:LTS |
All versions, plus listed versions 0.8.6-1 |
None known |
node-xmldomUbuntu:25.10 |
All versions, plus listed versions 0.9.6-1 |
None known |
node-xmldomUbuntu:26.10 |
All versions, plus listed versions 0.9.8-20.9.10-20.9.11-1 |
None known |
node-xmldomUbuntu:26.04:LTS |
All versions, plus listed versions 0.9.6-10.9.8-10.9.8-2 |
None known |
heroic-games-launcheropenSUSE:Tumbleweed |
before 2.20.1-5.1 | 2.20.1-5.1 |
python-jupyterlab-templatesopenSUSE:Tumbleweed |
before 0.5.3-1.1 | 0.5.3-1.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected | ||
| facts | OSV | |
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2026-34601 is a high vulnerability (CVSS 7.5) in Xmldom, published April 1, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.49%, the 42nd percentile. Fixed in @xmldom/xmldom 0.8.12.
References
github.com/xmldom/xmldom/security/advisories/GHSA-wh4c-j3r5-mjhp
github.com/xmldom/xmldom/commit/2b852e836ab86dbbd6cbaf0537f584dd0b5ac184
github.com/xmldom/xmldom/releases/tag/0.8.12
github.com/xmldom/xmldom/releases/tag/0.9.9
access.redhat.com/security/cve/CVE-2026-34601
bugzilla.redhat.com/show_bug.cgi?id=2454595
Show 9 moreShow less
security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-34601.json
nvd.nist.gov/vuln/detail/CVE-2026-34601
github.com/advisories/GHSA-wh4c-j3r5-mjhp
github.com/CVEProject/cvelistV5/tree/main/cves/2026/34xxx/CVE-2026-34601.json
security-tracker.debian.org/tracker/CVE-2026-34601
github.com/xmldom/xmldom
ubuntu.com/security/CVE-2026-34601
cve.org/CVERecord?id=CVE-2026-34601
suse.com/security/cve/CVE-2026-34601
Left out here: the rest of 2 source descriptions. The JSON record has them.