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

Source: https://junglewise.ai/threats/cve-2026-83605-xmldom-setattribute-attribute-name-injection  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-09-01. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

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

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.

Technologies: [@xmldom/xmldom (npm)](https://junglewise.ai/threats/technologies/xmldom-xmldom), [xmldom (npm)](https://junglewise.ai/threats/technologies/xmldom). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2026-83605 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-83605 being exploited in the wild.

**How severe is CVE-2026-83605?** High severity, with a CVSS score of 4, published 1 September 2026.

**Which products and versions are affected?** @xmldom/xmldom (npm) SEMVER:introduced=0.9.0,fixed=0.9.11; xmldom (npm) SEMVER:introduced=0,last_affected=0.6.0.

**Is there a fix for CVE-2026-83605?** Yes. @xmldom/xmldom (npm): upgrade to 0.9.11 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-83605 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-83605?** Check whether you run @xmldom/xmldom (npm) or xmldom (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- @xmldom/xmldom (npm): upgrade to 0.9.11 or later

  ```sh
  npm install @xmldom/xmldom@0.9.11
  ```


## 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

## Identifiers

- CVE-2026-83605
- GHSA-4w3w-2rp5-g8jm

## 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

- [https://api.github.com/users/bhaswanthc](https://api.github.com/users/bhaswanthc)
- [https://github.com/bhaswanthc](https://github.com/bhaswanthc)
- [https://api.github.com/users/bhaswanthc/gists%7B/gist_id%7D](https://api.github.com/users/bhaswanthc/gists%7B/gist_id%7D)
- [https://api.github.com/users/bhaswanthc/repos](https://api.github.com/users/bhaswanthc/repos)
- [https://avatars.githubusercontent.com/u/92464658?v=4](https://avatars.githubusercontent.com/u/92464658?v=4)
- [https://api.github.com/users/bhaswanthc/events%7B/privacy%7D](https://api.github.com/users/bhaswanthc/events%7B/privacy%7D)

## Related threats

- [xmldom end-tag whitespace-trim ReDoS](https://junglewise.ai/threats/cve-2026-83619-xmldom-end-tag-whitespace-trim-redos)
- [xmldom requireWellFormed DOCTYPE validation bypass via line terminator](https://junglewise.ai/threats/cve-2026-83618-xmldom-requirewellformed-doctype-validation-bypass-via-line)
- [xmldom XMLSerializer requireWellFormed bypass via line terminator](https://junglewise.ai/threats/cve-2026-83617-xmldom-xmlserializer-requirewellformed-bypass-via-line-terminator)
- [xmldom Processing Instruction Target Injection in serialization](https://junglewise.ai/threats/cve-2026-83616-xmldom-processing-instruction-target-injection-in-serialization)
- [xmldom quadratic-memory consumption in namespace parsing](https://junglewise.ai/threats/cve-2026-83615-xmldom-quadratic-memory-consumption-in-namespace-parsing)
