Junglewise Threat Intelligence

CVE-2026-83605: xmldom Attribute name injection via setAttribute()

CVE-2026-83605 · Severity: high · CVSS 4 · Published 2026-09-08

Executive brief

xmldom is a JavaScript XML DOM parser and serializer library. The setAttribute() method bypasses attribute name validation, allowing attackers to inject malicious attributes (including event handlers) into XML/HTML output. This is particularly dangerous in web applications that serialize untrusted XML data, as it can lead to cross-site scripting (XSS) attacks or override security-critical attributes like integrity checks and content security policies.

Technical details

The vulnerability stems from setAttribute(name, value) calling the private _createAttribute(name) method, which performs no validation on the name parameter, whereas the public createAttribute(name) API correctly validates names against the XML QName production. An attacker can craft attribute names containing special characters (e.g., 'class="safe" onclick') to inject additional attributes into the serialized output. The serializer escapes attribute values but emits attribute names verbatim, enabling the injection vector. The serializer's requireWellFormed flag initially did not validate attribute names during serialization, leaving the vulnerability undetected. A fix was applied in versions 0.9.11 and 0.8.14, but only when requireWellFormed: true is explicitly passed to serializeToString(); default serialization remains vulnerable. The residual issue is that setAttribute() itself does not validate names at creation time, leaving applications using default serialization exposed.

Affected products

  • xmldom @xmldom/xmldom >=0.9.0, <=0.9.10; >=0.7.0, <=0.8.13
  • xmldom xmldom <=0.6.0

Timeline

  • 2026-08-12: disclosed: Vulnerability published in GitHub Advisory Database
  • 2026-09-08: patched: Fixed in @xmldom/xmldom 0.9.11 and 0.8.14 under requireWellFormed: true flag

References