CVE-2026-83605: xmldom: Attribute name injection via setAttribute() bypasses requireWellFormed
Element.setAttribute() in @xmldom/xmldom bypasses attribute name validation by calling the private _createAttribute(name) method, which performs no validation. The public createAttribute() method correctly validates names against an anchored QName pattern, but setAttribute() never uses it. The serializer escapes attribute values but trusts attribute names, allowing an attacker to inject additional attributes (including event handlers) into serialized output. The requireWellFormed: true option did not catch this.
References
- github.com/advisories/GHSA-4w3w-2rp5-g8jm
- github.com/xmldom/xmldom/commit/cba1321218b069182695813fa7565653708e172e
- github.com/xmldom/xmldom/commit/d8212e632507eaf1d9f609657dd4c56abeb12d44
- github.com/xmldom/xmldom/pull/1043
- github.com/xmldom/xmldom/pull/1050
- github.com/xmldom/xmldom/releases/tag/0.8.14
- github.com/xmldom/xmldom/releases/tag/0.9.11
- github.com/xmldom/xmldom/security/advisories/GHSA-4w3w-2rp5-g8jm
- nvd.nist.gov/vuln/detail/CVE-2026-83605
Code Behaviors & Features
Detect and mitigate CVE-2026-83605 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →