CVE-2026-83609: xmldom Creation-time XML Name/QName Validation Is Vulnerability

HIGH
Advisory Identifier: GHSA-3px3-54cx-rmw9
CWE-91 CWE-625
Published
Advisory Summary

CVE-2026-83609 is a HIGH creation-time xml name/qname validation is vulnerability (CWE-91: XML Injection (aka Blind XPath Injection)) affecting xmldom libraries in the npm ecosystem. The issue involves creation-time xml name/qname validation is bypassable via an embedded line terminator, allowing injection on the default serialization path. Remediation is available by upgrading affected packages to version 0.9.12.

CVE-2026-83609 at a Glance

CVE Identifier CVE-2026-83609
GHSA Identifier GHSA-3px3-54cx-rmw9
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification CWE-91: XML Injection (aka Blind XPath Injection)
Affected Product xmldom
Package Ecosystem npm
Published Date
Last Updated

How to Fix CVE-2026-83609

To remediate this vulnerability, upgrade all affected xmldom dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@xmldom/xmldom fixed: 0.9.12
npm install @xmldom/xmldom@0.9.12
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @xmldom/xmldom

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-83609, inspect your project dependencies using npm:

npm ls @xmldom/xmldom

Analyze the terminal output to locate any version of xmldom in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.9.12), your application is affected.

Note: The npm ls @xmldom/xmldom command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-91: XML Injection (aka Blind XPath Injection), where the product does not properly neutralize special elements that are used in xml, allowing attackers to modify the syntax, content, or commands of the xml before it is processed by an end system. In xmldom, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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 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 ```js 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 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`. ## 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.

CVE-2026-83609 Affected xmldom Versions

1 component(s)
Fixed Versions:
0.9.12
Product / Package Ecosystem Affected Versions Fixed Version
@xmldom/xmldom
npm
≥ 0.9.0
< 0.9.12
0.9.12

References

Frequently Asked Questions

What is CVE-2026-83609?
CVE-2026-83609 is a security vulnerability in xmldom involving Creation-time XML Name/QName validation is bypassable via an embedded line terminator, allowing injection on the default serialization path under CWE-91: XML Injection (aka Blind XPath Injection).
Which xmldom versions are affected?
Affected versions include releases prior to 0.9.12 across affected packages: @xmldom/xmldom.
What version fixes CVE-2026-83609?
Upgrading to 0.9.12 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @xmldom/xmldom affected?
Yes, @xmldom/xmldom is affected in releases prior to 0.9.12. Upgrade your dependency to 0.9.12 or later.
What CWE is associated with CVE-2026-83609?
CVE-2026-83609 is classified under CWE-91: XML Injection (aka Blind XPath Injection) (The product does not properly neutralize special elements that are used in XML, allowing attackers to modify the syntax, content, or commands of the XML before it is processed by an end system.).
How can I check npm dependencies for CVE-2026-83609?
Run the dependency tree command: 'npm ls @xmldom/xmldom'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3px3-54cx-rmw9",
  "modified" : "2026-09-08T21:02:33Z",
  "published" : "2026-09-08T21:02:33Z",
  "aliases" : [ "CVE-2026-83609" ],
  "summary" : "xmldom: Creation-time XML Name/QName validation is bypassable via an embedded line terminator, allowing injection on the default serialization path",
  "details" : "## Summary\n\nAn embedded line terminator bypasses xmldom's always-on, WHATWG-mandated creation-time name\nvalidation. `createElementNS`, `createAttributeNS`, `createDocumentType`, and `createAttribute` should\nreject a malformed qualified name with `InvalidCharacterError`, but a name whose first line is\nwell-formed slips through and enters the DOM. On serialization it is emitted verbatim, so the\ncharacters after the line terminator inject markup into the output. The injection reaches the default\nserialization path, and enabling `requireWellFormed` does not prevent it.\n\n## Details\n\n`createElementNS`, `createAttributeNS`, and `createDocumentType` route through `validateQualifiedName`,\nand `createAttribute` performs the analogous check; each validates the name with\n`g.QName_exact.test(name)`. `QName_exact = reg('^', QName, '$')` inherits the `m` flag from xmldom's\nshared regexp builder, so the matcher accepts any name whose first line is a valid `QName` and leaves\nthe remaining lines unconstrained (see Root Cause).\n\n### Root Cause\n\n1. A shared regexp builder compiles anchored productions with the `m` flag.\n2. `^…$` under `m` are line anchors, not string anchors.\n3. `validateQualifiedName` / `createAttribute` validate with `.test()` against such a production, so a\n   line terminator followed by breakout markup passes and the malformed name is stored.\n\nThe triggering line terminators are the ECMAScript `LineTerminator` set: U+000A, U+000D, U+2028, U+2029.\n\n## Proof of Concept\n\n```js\nconst { DOMImplementation, XMLSerializer } = require('@xmldom/xmldom');\nconst impl = new DOMImplementation();\n\nconst doc = impl.createDocument('urn:x', 'root', null);\nconst el = doc.createElementNS('urn:x', 'a\\n><script>x</script');  // ACCEPTED (no throw)\ndoc.documentElement.appendChild(el);\n\n// DEFAULT serialization — requireWellFormed NOT set:\nconsole.log(new XMLSerializer().serializeToString(doc));\n// Observed: <root xmlns=\"urn:x\"><a\n// ><script>x</script/></root>          <-- injected element on the default path\n// Control: createElementNS('urn:x', 'bad>name') throws InvalidCharacterError, confirming the check is\n// active and specifically bypassed by the line terminator.\n```\n\n## Impact\n\n- **Bypass of the always-on WHATWG creation-time name validation** (`InvalidCharacterError`): a\n  malformed name the standard requires be rejected at creation is instead admitted to the DOM.\n- **Markup / structure injection.** An application relying on the `create*` APIs to reject malformed\n  names (the standard behavior) as a trust boundary is exposed; where the serialized output reaches an\n  HTML context, downstream XSS.\n- **No serializer option mitigates it.** The admitted name is emitted verbatim under *both* the default\n  path and `requireWellFormed: true` — the strict serializer shares the same `m`-flagged blind spot\n  (the subject of the sibling serializer advisories) — so the bypassed creation-time check was the only\n  layer that could have stopped it. Demonstrated for all four `create*` sites in\n  `poc_creation_strict_serialization_bypass.cjs`.\n\n## Fix Applied\n\n`createElementNS`, `createAttributeNS`, `createDocumentType`, and `createAttribute` now reject a name\ncontaining a line terminator with `InvalidCharacterError` — the same result they already give for\nother malformed names — because name validation now applies to the whole string. The\n`requireWellFormed` serializer's name checks are corrected by the same change. The fix is\nnon-breaking: such a name was already invalid, and no previously-accepted well-formed name is affected.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "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"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@xmldom/xmldom"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.9.0"
      }, {
        "fixed" : "0.9.12"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 0.9.11"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/xmldom/xmldom/security/advisories/GHSA-3px3-54cx-rmw9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-83609"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/xmldom/xmldom/pull/1071"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/xmldom/xmldom/commit/7b2ec67e1750daadd0bb06c92e875e726544a362"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/xmldom/xmldom"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/xmldom/xmldom/releases/tag/0.9.12"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-625", "CWE-91" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-08T21:02:33Z",
    "nvd_published_at" : "2026-09-01T15:17:38Z"
  }
}