Skip to content

CVE-2022-39353 xmldom allows multiple root nodes in a DOM

CriticalCVSS 9.8 EPSS 1.6%
Published
Updated
Exploit status
No public exploit known
CISA SSVC
Proof of concept public · automatable: yes · technical impact: partial
Technology
UbuntuDebian

Description

xmldom is a pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. xmldom parses XML that is not well-formed because it contains multiple top level elements, and adds all root nodes to the childNodes collection of the Document, without reporting any error or throwing. This breaks the assumption that there is only a single root node in the tree, which led to issuance of CVE-2022-39299 as it is a potential issue for dependents. Update to @xmldom/xmldom@~0.7.7, @xmldom/xmldom@~0.8.4 (dist-tag latest) or @xmldom/xmldom@>=0.9.0-beta.4 (dist-tag next). As a workaround, please one of the following approaches depending on your use case: instead of searching for elements in the whole DOM, only search in the documentElementor reject a document with a document that has more then 1 childNode.

Upgrade path

11 packages: 8 fixed, 1 with no fix yet.

PackageAffectedFixed inStatus
ubuntu/node-xmldom(Ubuntu 25.10) = 0.9.6-1; All versions No fix listed No fix yet
debian/node-xmldom(Debian 12) < 0.8.6-1 0.8.6-1 Fixed
debian/node-xmldom(Debian 13) < 0.8.6-1 0.8.6-1 Fixed
debian/node-xmldom(Debian 14) < 0.8.6-1 0.8.6-1 Fixed
npm xmldom(npm) <= 0.6.0 after 0.6.0 Fixed
ubuntu/node-xmldom(Ubuntu 20.04) < 0.1.27+ds-1+deb10u2build0.20.04.1; = 0.1.27+ds-1 0.1.27+ds-1+deb10u2build0.20.04.1 Fixed
ubuntu/node-xmldom(Ubuntu 22.04) < 0.7.5-1ubuntu0.22.04.1; = 0.5.0-1; = 0.7.3-1; = 0.7.5-1 0.7.5-1ubuntu0.22.04.1 Fixed
xmldom(npm) < 0.7.7; >= 0.8.0, < 0.8.4; >= 0.9.0-beta.1, < 0.9.0-beta.4 0.7.7, 0.8.4, 0.9.0-beta.4 Fixed
xmldom project xmldom < 0.6.0; = 0.9.0-beta1; = 0.9.0-beta2; = 0.9.0-beta3 +2 more 0.6.0, 0.7.7, 0.8.4 Fixed
debian linux = 10.0 No fix listed Versions listed
xmldom = < 0.7.7; = <= 0.6.0; = >= 0.8.0, < 0.8.4; = >= 0.9.0-beta.1, < 0.9.0-beta.4 No fix listed Versions listed

Affected products

ProductAffected versionsFixed in
npm xmldom(npm) <= 0.6.0 No fix listed
xmldom(npm) < 0.7.7 0.7.7
xmldom(npm) >= 0.8.0, < 0.8.4 0.8.4
xmldom(npm) >= 0.9.0-beta.1, < 0.9.0-beta.4 0.9.0-beta.4
xmldom = <= 0.6.0 No fix listed
xmldom = < 0.7.7 No fix listed
xmldom = >= 0.8.0, < 0.8.4 No fix listed
xmldom = >= 0.9.0-beta.1, < 0.9.0-beta.4 No fix listed
ubuntu/node-xmldom(Ubuntu:22.04) < 0.7.5-1ubuntu0.22.04.1 0.7.5-1ubuntu0.22.04.1
xmldom project xmldom < 0.6.0 0.6.0
xmldom project xmldom >= 0.7.0, < 0.7.7 0.7.7
xmldom project xmldom >= 0.8.0, < 0.8.4 0.8.4
xmldom project xmldom = 0.9.0-beta1 No fix listed
xmldom project xmldom = 0.9.0-beta2 No fix listed
xmldom project xmldom = 0.9.0-beta3 No fix listed
debian linux = 10.0 No fix listed
debian/node-xmldom(Debian:12) < 0.8.6-1 0.8.6-1
debian/node-xmldom(Debian:14) < 0.8.6-1 0.8.6-1
debian/node-xmldom(Debian:13) < 0.8.6-1 0.8.6-1
ubuntu/node-xmldom(Ubuntu:20.04) < 0.1.27+ds-1+deb10u2build0.20.04.1 0.1.27+ds-1+deb10u2build0.20.04.1
ubuntu/node-xmldom(Ubuntu:20.04) = 0.1.27+ds-1 No fix listed
ubuntu/node-xmldom(Ubuntu:22.04) = 0.5.0-1 No fix listed
ubuntu/node-xmldom(Ubuntu:22.04) = 0.7.3-1 No fix listed
ubuntu/node-xmldom(Ubuntu:22.04) = 0.7.5-1 No fix listed
ubuntu/node-xmldom(Ubuntu:25.10) All versions No fix listed
Show 1 more
ProductAffected versionsFixed in
ubuntu/node-xmldom(Ubuntu:25.10) = 0.9.6-1 No fix listed

References