CVE-2022-39353

Source
https://nvd.nist.gov/vuln/detail/CVE-2022-39353
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-39353.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2022-39353
Aliases
Downstream
Published
2022-11-02T00:00:00Z
Modified
2025-10-14T19:13:48.770389Z
Severity
  • 9.4 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H CVSS Calculator
Summary
xmldom allows multiple root nodes in a DOM
Details

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.

References

Affected packages

Git / github.com/xmldom/xmldom

Affected ranges

Type
GIT
Repo
https://github.com/xmldom/xmldom
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Last affected
Type
GIT
Repo
https://github.com/xmldom/xmldom
Events
Introduced
0 Unknown introduced commit / All previous commits are affected
Fixed
Type
GIT
Repo
https://github.com/xmldom/xmldom
Events
Type
GIT
Repo
https://github.com/xmldom/xmldom
Events

Affected versions

0.*

0.2.0
0.2.1
0.3.0
0.4.0
0.5.0
0.6.0
0.7.0
0.7.0+scoped
0.7.0+unscoped
0.7.1
0.7.2
0.7.3
0.7.4
0.7.5
0.7.6
0.8.0
0.8.1
0.8.2
0.8.3
0.9.0-beta.1
0.9.0-beta.2
0.9.0-beta.3

v0.*

v0.1.16
v0.1.27
v0.1.28-not-published
v0.1.28-xmldom-alpha
v0.7.0

xmldom-aplha@v0.*

xmldom-aplha@v0.1.28