CVE-2026-83605

xmldom: Attribute name injection via setAttribute() bypasses requireWellFormed

Published Sep 1, 2026 CVSS 4.0 · 8.7 High EPSS < 1% KEV · Not listed
Description
xmldom is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. Prior to @xmldom/xmldom versions 0.8.14 and 0.9.11, and in xmldom version 0.6.0 and earlier, Element.setAttribute() calls the private _createAttribute(name) path without validating the attribute name, while Document.createAttribute(name) validates against QName. XMLSerializer.serializeToString() emits attribute names verbatim, and requireWellFormed: true did not validate them, so a crafted name can terminate the intended attribute and inject additional attributes, including event handlers, into browser-consumed output; synthesized xmlns:PREFIX declarations expose the same unchecked-name boundary. This issue is fixed in @xmldom/xmldom versions 0.8.14 and 0.9.11; no fixed version is available for xmldom.

Analysis

AI-generated

Technical impact

The vulnerability lies in the Element.setAttribute() method of xmldom, which calls an unvalidated internal path, allowing a crafted attribute name to terminate the intended attribute and inject additional attributes, including event handlers, into serialized XML. When this XML is consumed by a browser, the injected attributes can execute unintended code, resulting in XSS or other DOM‑level attacks. The flaw is a classic Attribute Injection weakness (CWE‑91) and a stored Cross‑Site Scripting vector (CWE‑79).

Affected Systems

Vendors: @xmldom/xmldom and xmldom; product: xmldom. Affected versions are all releases prior to 0.8.14 and 0.9.11 of @xmldom/xmldom, and xmldom 0.6.0 and earlier. Any installation using these versions that retrieves XML via xmldom and subsequently renders it in a browser is at risk.

Risk and Exploitability

The CVSS score of 8.7 indicates high severity, and while EPSS data is not available, the issue is not yet listed in the CISA KEV catalog. Exploitation requires that the serialized XML be delivered to a browser context; the attacker must craft XML that, when parsed by xmldom, produces malicious attributes. Because the requireWellFormed flag does not enforce attribute name validation, detection is non‑trivial, making an attacker’s job easier. A successful injection directly yields cross‑site scripting through event handlers or other injected attributes.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade to @xmldom/xmldom version 0.8.14 or later (or 0.9.11 or newer).
  • If the project cannot upgrade, replace xmldom with a library that performs proper QName validation on attributes.
  • If neither replacement nor upgrade is possible, sanitize or validate all attribute names before calling setAttribute, ensuring they do not contain characters that could terminate the attribute or inject new ones.

Generated by OpenCVE AI on September 2, 2026 at 04:12 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-4w3w-2rp5-g8jm xmldom: Attribute name injection via setAttribute() bypasses requireWellFormed
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Weaknesses CWE-79
References
Metrics threat_severity

None

cvssV3_1

{'score': 8.1, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N'}

threat_severity

Important

Type Values Removed Values Added
First Time appeared Xmldom
Xmldom xmldom
Vendors & Products Xmldom
Xmldom xmldom
Type Values Removed Values Added
Description xmldom is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. Prior to @xmldom/xmldom versions 0.8.14 and 0.9.11, and in xmldom version 0.6.0 and earlier, Element.setAttribute() calls the private _createAttribute(name) path without validating the attribute name, while Document.createAttribute(name) validates against QName. XMLSerializer.serializeToString() emits attribute names verbatim, and requireWellFormed: true did not validate them, so a crafted name can terminate the intended attribute and inject additional attributes, including event handlers, into browser-consumed output; synthesized xmlns:PREFIX declarations expose the same unchecked-name boundary. This issue is fixed in @xmldom/xmldom versions 0.8.14 and 0.9.11; no fixed version is available for xmldom.
Title xmldom: Attribute name injection via setAttribute() bypasses requireWellFormed
Weaknesses CWE-91
References
Metrics cvssV4_0

{'score': 8.7, 'vector': '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'}

Weaknesses
  • CWE-79

    Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

  • CWE-91

    XML Injection (aka Blind XPath Injection)

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Sep 3, 2026, 5:35 PM
Reserved
Aug 31, 2026, 8:36 PM
Status
Deferred
Published
Sep 1, 2026, 3:17 PM
Modified
Sep 8, 2026, 9:11 PM
Severity
Important
Public date
Sep 1, 2026, 2:18 PM