CVE-2026-83609
xmldom: Creation-time XML Name/QName validation is bypassable via an embedded line terminator, allowing injection on the default serialization path
xmldom is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. From 0.9.0 until 0.9.12, the shared reg() builder in lib/grammar.js compiles the anchored QName_exact validator with the multiline flag, so ^ and $ validate only one line instead of the complete name. createElementNS, createAttributeNS, createDocumentType, and createAttribute consequently accept a malformed XML name whose first line is valid and whose later text injects markup when serialized through either the default path or requireWellFormed: true. The triggering ECMAScript line terminators are U+000A, U+000D, U+2028, and U+2029. This issue is fixed in @xmldom/xmldom version 0.9.12.
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
8.7
xmldom: Creation-time XML Name/QName validation is bypassable via an embedded line terminator, allowing injection on the default serialization path
xmldom is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. From 0.9.0 until 0.9.12, the shared reg() builder in lib/grammar.js compiles the anchored QName_exact validator with the multiline flag, so ^ and $ validate only one line instead of the complete name. createElementNS, createAttributeNS, createDocumentType, and createAttribute consequently accept a malformed XML name whose first line is valid and whose later text injects markup when serialized through either the default path or requireWellFormed: true. The triggering ECMAScript line terminators are U+000A, U+000D, U+2028, and U+2029. This issue is fixed in @xmldom/xmldom version 0.9.12.
- Record
CVE-2026-83609- CVSS 4.0
- 8.7 High
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 - Weakness
- CWE-91, CWE-625
- Updated
- 2026-11-02
EUVDEUVD-2026-69220
8.7
xmldom is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. From 0.9.0 until 0.9.12, the shared reg() builder in lib/grammar.js compiles the anchored QName_exact validator with the multiline flag, so ^ and $ validate only one line instead of the complete name. createElementNS, createAttributeNS, createDocumentType, and createAttribute consequently accept a malformed XML name whose first line is valid and whose later text injects markup when serialized through either the default path or requireWellFormed: true. The triggering ECMAScript line terminators are U+000A, U+000D, U+2028, and U+2029. This issue is fixed in @xmldom/xmldom version 0.9.12.
- Record
EUVD-2026-69220- CVSS 4.0
- 8.7 High
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 - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-3px3-54cx-rmw9
8.7
xmldom: Creation-time XML Name/QName validation is bypassable via an embedded line terminator, allowing injection on the default serialization path
Summary
An embedded line terminator bypasses xmldom's always-on, WHATWG-mandated creation-time name
validation. createElementNS, createAttributeNS, createDocumentType, and createAttribute should
reject a malformed qualified name with InvalidCharacterError, but a name whose first line is
well-formed slips through and enters the DOM. On serialization it is emitted verbatim, so the
characters after the line terminator inject markup into the output. The injection reaches the default
serialization path, and enabling requireWellFormed does not prevent it.
Details
createElementNS, createAttributeNS, and createDocumentType route through validateQualifiedName,
and createAttribute performs the analogous check; each validates the name with
g.QName_exact.test(name). QName_exact = reg('^', QName, '$') inherits the m flag from xmldom's
shared regexp builder, so the matcher accepts any name whose first line is a valid QName and leaves
the remaining lines unconstrained (see Root Cause).
Root Cause
- A shared regexp builder compiles anchored productions with the
mflag. ^…$undermare line anchors, not string anchors.validateQualifiedName/createAttributevalidate with.test()against such a production, so a line terminator followed by breakout markup passes and the malformed name is stored.
The triggering line terminators are the ECMAScript LineTerminator set: U+000A, U+000D, U+2028, U+2029.
Proof of Concept
const { DOMImplementation, XMLSerializer } = require('@xmldom/xmldom');
const impl = new DOMImplementation();
const doc = impl.createDocument('urn:x', 'root', null);
const el = doc.createElementNS('urn:x', 'a\n><script>x</script'); // ACCEPTED (no throw)
doc.documentElement.appendChild(el);
// DEFAULT serialization — requireWellFormed NOT set:
console.log(new XMLSerializer().serializeToString(doc));
// Observed: <root xmlns="urn:x"><a
// ><script>x</script/></root> <-- injected element on the default path
// Control: createElementNS('urn:x', 'bad>name') throws InvalidCharacterError, confirming the check is
// active and specifically bypassed by the line terminator.
Impact
- Bypass of the always-on WHATWG creation-time name validation (
InvalidCharacterError): a malformed name the standard requires be rejected at creation is instead admitted to the DOM. - Markup / structure injection. An application relying on the
create*APIs to reject malformed names (the standard behavior) as a trust boundary is exposed; where the serialized output reaches an HTML context, downstream XSS. - No serializer option mitigates it. The admitted name is emitted verbatim under both the default
path and
requireWellFormed: true— the strict serializer shares the samem-flagged blind spot (the subject of the sibling serializer advisories) — so the bypassed creation-time check was the only layer that could have stopped it. Demonstrated for all fourcreate*sites inpoc_creation_strict_serialization_bypass.cjs.
Fix Applied
createElementNS, createAttributeNS, createDocumentType, and createAttribute now reject a name
containing a line terminator with InvalidCharacterError — the same result they already give for
other malformed names — because name validation now applies to the whole string. The
requireWellFormed serializer's name checks are corrected by the same change. The fix is
non-breaking: such a name was already invalid, and no previously-accepted well-formed name is affected.
- Record
GHSA-3px3-54cx-rmw9- CVSS 4.0
- 8.7 High
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 - Weakness
- CWE-91, CWE-625
- Updated
- 2026-11-02
NVD
8.7
xmldom is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. From 0.9.0 until 0.9.12, the shared reg() builder in lib/grammar.js compiles the anchored QName_exact validator with the multiline flag, so ^ and $ validate only one line instead of the complete name. createElementNS, createAttributeNS, createDocumentType, and createAttribute consequently accept a malformed XML name whose first line is valid and whose later text injects markup when serialized through either the default path or requireWellFormed: true. The triggering ECMAScript line terminators are U+000A, U+000D, U+2028, and U+2029. This issue is fixed in @xmldom/xmldom version 0.9.12.
- Record
CVE-2026-83609- CVSS 4.0
- 8.7 High
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Weakness
- CWE-91, CWE-625
- Updated
- 2026-11-02
OSV
8.7
xmldom: Creation-time XML Name/QName validation is bypassable via an embedded line terminator, allowing injection on the default serialization path
xmldom is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. From 0.9.0 until 0.9.12, the shared reg() builder in lib/grammar.js compiles the anchored QName_exact validator with the multiline flag, so ^ and $ validate only one line instead of the complete name. createElementNS, createAttributeNS, createDocumentType, and createAttribute consequently accept a malformed XML name whose first line is valid and whose later text injects markup when serialized through either the default path or requireWellFormed: true. The triggering ECMAScript line terminators are U+000A, U+000D, U+2028, and U+2029. This issue is fixed in @xmldom/xmldom version 0.9.12.
- Record
CVE-2026-83609- CVSS 4.0
- 8.7 High
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 - Weakness
- CWE-625, CWE-91
- Updated
- 2026-11-02
OSVDEBIAN-CVE-2026-83609
8.7
xmldom is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. From 0.9.0 until 0.9.12, the shared reg() builder in lib/grammar.js compiles the anchored QName_exact validator with the multiline flag, so ^ and $ validate only one line instead of the complete name. createElementNS, createAttributeNS, createDocumentType, and createAttribute consequently accept a malformed XML name whose first line is valid and whose later text injects markup when serialized through either the default path or requireWellFormed: true. The triggering ECMAScript line terminators are U+000A, U+000D, U+2028, and U+2029. This issue is fixed in @xmldom/xmldom version 0.9.12.
- Record
DEBIAN-CVE-2026-83609- CVSS 4.0
- 8.7 High
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Updated
- 2026-11-02
Show 6 moreShow less
OSVGHSA-3px3-54cx-rmw9
8.7
xmldom: Creation-time XML Name/QName validation is bypassable via an embedded line terminator, allowing injection on the default serialization path
Summary
An embedded line terminator bypasses xmldom's always-on, WHATWG-mandated creation-time name
validation. createElementNS, createAttributeNS, createDocumentType, and createAttribute should
reject a malformed qualified name with InvalidCharacterError, but a name whose first line is
well-formed slips through and enters the DOM. On serialization it is emitted verbatim, so the
characters after the line terminator inject markup into the output. The injection reaches the default
serialization path, and enabling requireWellFormed does not prevent it.
Details
createElementNS, createAttributeNS, and createDocumentType route through validateQualifiedName,
and createAttribute performs the analogous check; each validates the name with
g.QName_exact.test(name). QName_exact = reg('^', QName, '$') inherits the m flag from xmldom's
shared regexp builder, so the matcher accepts any name whose first line is a valid QName and leaves
the remaining lines unconstrained (see Root Cause).
Root Cause
- A shared regexp builder compiles anchored productions with the
mflag. ^…$undermare line anchors, not string anchors.validateQualifiedName/createAttributevalidate with.test()against such a production, so a line terminator followed by breakout markup passes and the malformed name is stored.
The triggering line terminators are the ECMAScript LineTerminator set: U+000A, U+000D, U+2028, U+2029.
Proof of Concept
const { DOMImplementation, XMLSerializer } = require('@xmldom/xmldom');
const impl = new DOMImplementation();
const doc = impl.createDocument('urn:x', 'root', null);
const el = doc.createElementNS('urn:x', 'a\n><script>x</script'); // ACCEPTED (no throw)
doc.documentElement.appendChild(el);
// DEFAULT serialization — requireWellFormed NOT set:
console.log(new XMLSerializer().serializeToString(doc));
// Observed: <root xmlns="urn:x"><a
// ><script>x</script/></root> <-- injected element on the default path
// Control: createElementNS('urn:x', 'bad>name') throws InvalidCharacterError, confirming the check is
// active and specifically bypassed by the line terminator.
Impact
- Bypass of the always-on WHATWG creation-time name validation (
InvalidCharacterError): a malformed name the standard requires be rejected at creation is instead admitted to the DOM. - Markup / structure injection. An application relying on the
create*APIs to reject malformed names (the standard behavior) as a trust boundary is exposed; where the serialized output reaches an HTML context, downstream XSS. - No serializer option mitigates it. The admitted name is emitted verbatim under both the default
path and
requireWellFormed: true— the strict serializer shares the samem-flagged blind spot (the subject of the sibling serializer advisories) — so the bypassed creation-time check was the only layer that could have stopped it. Demonstrated for all fourcreate*sites inpoc_creation_strict_serialization_bypass.cjs.
Fix Applied
createElementNS, createAttributeNS, createDocumentType, and createAttribute now reject a name
containing a line terminator with InvalidCharacterError — the same result they already give for
other malformed names — because name validation now applies to the whole string. The
requireWellFormed serializer's name checks are corrected by the same change. The fix is
non-breaking: such a name was already invalid, and no previously-accepted well-formed name is affected.
- Record
GHSA-3px3-54cx-rmw9- CVSS 4.0
- 8.7 High
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 - Weakness
- CWE-625, CWE-91
- Updated
- 2026-11-02
OSVUBUNTU-CVE-2026-83609
8.7
xmldom is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. From 0.9.0 until 0.9.12, the shared reg() builder in lib/grammar.js compiles the anchored QName_exact validator with the multiline flag, so ^ and $ validate only one line instead of the complete name. createElementNS, createAttributeNS, createDocumentType, and createAttribute consequently accept a malformed XML name whose first line is valid and whose later text injects markup when serialized through either the default path or requireWellFormed: true. The triggering ECMAScript line terminators are U+000A, U+000D, U+2028, and U+2029. This issue is fixed in @xmldom/xmldom version 0.9.12.
- Record
UBUNTU-CVE-2026-83609- CVSS 4.0
- 8.7 High
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 - Updated
- 2026-11-02
OSVCLSA-2026-1790760268 No score
TuxCare security update for @xmldom/xmldom (4 CVEs)
TuxCare rebuilt @xmldom/xmldom to address 4 CVEs. Fixed in 0.9.10-tuxcare.2.
- Record
CLSA-2026-1790760268- 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
OSVCLSA-2026-1793108546 No score
TuxCare security update for @xmldom/xmldom (1 CVE)
TuxCare rebuilt @xmldom/xmldom to address 1 CVE. Fixed in 0.7.13-tuxcare.3.
- Record
CLSA-2026-1793108546- Updated
- 2026-11-02
OSVROOT-APP-NPM-CVE-2026-83609 No score
CVE-2026-83609 in @xmldom/xmldom - Patched by Root
Root has patched CVE-2026-83609 in the @xmldom/xmldom package for Root:npm. Multiple fixed versions available.
- Record
ROOT-APP-NPM-CVE-2026-83609- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
@xmldom/xmldomnpm |
0.9.0 to 0.9.11 | 0.9.12 |
@xmldom/xmldomTuxCare:npm From an advisory covering 4 CVEs |
0.9.10-tuxcare.0 up to 0.9.10-tuxcare.2, plus listed versions 0.9.100.9.10-tuxcare.1 |
0.9.10-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 |
@xmldom/xmldomTuxCare:npm |
0.7.13-tuxcare.0 up to 0.7.13-tuxcare.3, plus listed versions 0.7.130.7.13-tuxcare.10.7.13-tuxcare.2 |
0.7.13-tuxcare.3 |
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.12-1, plus listed versions 0.9.10-10.9.10-20.9.11-10.9.6-10.9.8-10.9.8-20.9.9-1 |
0.9.12-1 |
@xmldom/xmldomnpm |
0.9.0 up to 0.9.12 | 0.9.12 |
@xmldom/xmldomRoot:npm |
before 0.9.11-aikido.1 | 0.9.11-aikido.1 |
@rootio/xmldom__xmldomRoot:npm |
before 0.9.11-root.io.1 | 0.9.11-root.io.1 |
Show 5 moreShow less
| Package | Affected | Fixed |
|---|---|---|
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: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 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| 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-83609 is a high vulnerability (CVSS 8.7) in @xmldom Xmldom, published September 1, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.54%, the 45th percentile. Fixed in @xmldom/xmldom 0.9.12.