Vulnerabilities / CVE-2022-39353

critical

CVE-2022-39353

xmldom: Allows multiple root elements in a DOM tree

Published Modified CWE 20, 1288
In the Trivy database since at least 24 Oct 2026, 07:11 UTCWhen it arrived before that build is not recorded.

Severity by source

NVD9.8CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
GHSA9.8CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Red Hat9.4CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H

Trivy's own label is CRITICAL. Rated critical by NVD, GHSA, Azure Linux. Rated lower by Red Hat (high), Ubuntu (medium).

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 `documentElement`or reject a document with a document that has more then 1 `childNode`.

Affected packages and fixed versions

SourcePackageFixed in
Azure Linux 3.0python-tensorboard0:2.16.2-1.azl3
npm::GitHub Security Advisory npm@xmldom/xmldom, xmldom0.7.7, 0.8.4, 0.9.0-beta.4
chainguardwazuh-dashboard, wazuh-dashboard-fips4.14.6-r3 and 1 more
debian 10node-xmldom0.1.27+ds-1+deb10u2
debian 11node-xmldom0.5.0-1+deb11u2
debian 12node-xmldom0.8.6-1
debian 13node-xmldom0.8.6-1
debian 14node-xmldom0.8.6-1
echonode-xmldom0.8.6-1
rapidfort ubuntu 20.04node-xmldom0:0.7.5-1ubuntu0.22.04.1
rapidfort ubuntu 22.04node-xmldom0:0.7.5-1ubuntu0.22.04.1
rapidfort ubuntu 24.04node-xmldom0:0.7.5-1ubuntu0.22.04.1
Show all 18 entries from 16 sources
SourcePackageFixed in
Azure Linux 3.0python-tensorboard0:2.16.2-1.azl3
npm::GitHub Security Advisory npm@xmldom/xmldom0.7.7, 0.8.4, 0.9.0-beta.4
npm::GitHub Security Advisory npmxmldomno fix listed
chainguardwazuh-dashboard4.14.6-r3
chainguardwazuh-dashboard-fips4.14.6-r1
debian 10node-xmldom0.1.27+ds-1+deb10u2
debian 11node-xmldom0.5.0-1+deb11u2
debian 12node-xmldom0.8.6-1
debian 13node-xmldom0.8.6-1
debian 14node-xmldom0.8.6-1
echonode-xmldom0.8.6-1
rapidfort ubuntu 20.04node-xmldom0:0.7.5-1ubuntu0.22.04.1
rapidfort ubuntu 22.04node-xmldom0:0.7.5-1ubuntu0.22.04.1
rapidfort ubuntu 24.04node-xmldom0:0.7.5-1ubuntu0.22.04.1
ubuntu 20.04node-xmldom0.1.27+ds-1+deb10u2build0.20.04.1
ubuntu 20.04-ESMnode-xmldom0.1.27+ds-1+deb10u2build0.20.04.1
ubuntu 22.04node-xmldom0.7.5-1ubuntu0.22.04.1
ubuntu 22.10node-xmldom0.7.5-1ubuntu0.22.10.1

References

All 14 references

Vulnerability data compiled from the Trivy vulnerability database (trivy-db, Aqua Security, Apache License 2.0), which aggregates third-party advisories. CVE records are published by The MITRE Corporation under the CVE Terms of Use; CVE is a trademark of MITRE. This product uses data from the NVD API but is not endorsed or certified by the NVD. Severity, titles and advisory data from the GitHub Advisory Database (CC BY 4.0), Red Hat security data (CC BY 4.0) and the other sources linked on each entry. Entries may be summarised or re-formatted; the linked original is the authoritative record.