CVE-2026-83609

CVE-2026-83609 is a high-severity security vulnerability in @xmldom/xmldom (npm), affecting versions >= 0.9.0, <= 0.9.11. It is fixed in 0.9.12.

Does this CVE actually affect you?

Kodem shows which CVEs are reachable and running in your applications, so you fix what's exploitable, not just what's listed.

Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.

Runtime intelligence, not another scanner.

Summary

xmldom: Creation-time XML Name/QName validation is bypassable via an embedded line terminator, allowing injection on the default serialization path

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

  1. A shared regexp builder compiles anchored productions with the m flag.
  2. ^…$ under m are line anchors, not string anchors.
  3. validateQualifiedName / createAttribute validate 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.

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.

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 same m-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 four create* sites in
    poc_creation_strict_serialization_bypass.cjs.

Affected versions

@xmldom/xmldom (>= 0.9.0, <= 0.9.11)

Security releases

@xmldom/xmldom → 0.9.12 (npm)

Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.

Already deployed Kodem?

See it in your environmentNew to Kodem? Get a demo →

Remediation advice

Upgrade @xmldom/xmldom to 0.9.12 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently Asked Questions

  1. What is CVE-2026-83609? CVE-2026-83609 is a high-severity security vulnerability in @xmldom/xmldom (npm), affecting versions >= 0.9.0, <= 0.9.11. It is fixed in 0.9.12.
  2. Which versions of @xmldom/xmldom are affected by CVE-2026-83609? @xmldom/xmldom (npm) versions >= 0.9.0, <= 0.9.11 is affected.
  3. Is there a fix for CVE-2026-83609? Yes. CVE-2026-83609 is fixed in 0.9.12. Upgrade to this version or later.
  4. Is CVE-2026-83609 exploitable, and should I be worried? Whether CVE-2026-83609 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
  5. What actually determines whether CVE-2026-83609 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
  6. How do I fix CVE-2026-83609? Upgrade @xmldom/xmldom to 0.9.12 or later.

Stop the waste.
Protect your environment with Kodem.