CVE-2022-39353

Public Exploit
xmldom allows multiple root nodes in a DOM

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`.

Category

9.4
CVSS
Severity: Critical
CVSS 3.1 •
EPSS 0.89% Top 30%
Third-Party Advisory github.com Third-Party Advisory github.com Third-Party Advisory debian.org
Affected: xmldom xmldom
Published at:
Updated at:

References

Frequently Asked Questions

What is the severity of CVE-2022-39353?
CVE-2022-39353 has been scored as a critical severity vulnerability.
How to fix CVE-2022-39353?
To fix CVE-2022-39353, make sure you are using an up-to-date version of the affected component(s) by checking the vendor release notes. As for now, there are no other specific guidelines available.
Is CVE-2022-39353 being actively exploited in the wild?
It is possible that CVE-2022-39353 is being exploited or will be exploited in a near future based on public information. According to its EPSS score, there is a ~1% probability that this vulnerability will be exploited by malicious actors in the next 30 days.
What software or system is affected by CVE-2022-39353?
CVE-2022-39353 affects xmldom xmldom.
This platform uses data from the NIST NVD, MITRE CVE, MITRE CWE, First.org and CISA KEV but is not endorsed or certified by these entities. CVE is a registred trademark of the MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. CWE is a registred trademark of the MITRE Corporation and the authoritative source of CWE content is MITRE's CWE web site.
© 2025 Under My Watch. All Rights Reserved.