Every CVE Search/ Get API key

CVE-2022-39353

xmldom allows multiple root nodes in a DOM

9.4 CriticalFix available

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.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
Low
Integrity
High
Availability
High

Exploit likelihood

1.56%Up 0.7 points since Nov 3, 2022
90%50%10%1%

What each source reports

CVE List Score used 9.4

xmldom allows multiple root nodes in a DOM

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.

Record
CVE-2022-39353
CVSS 3.1
9.4 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H
Weakness
CWE-20, CWE-1288
Updated
2026-11-02
EUVDEUVD-2022-7316 9.4

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.

Record
EUVD-2022-7316
CVSS 3.1
9.4 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H
Updated
2026-11-02
GitHub AdvisoriesGHSA-crh6-fp67-6883 9.8

xmldom allows multiple root nodes in a DOM

Impact

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 https://nvd.nist.gov/vuln/detail/CVE-2022-39299 and is a potential issue for dependents.

Patches

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

Workarounds

One of the following approaches might help, depending on your use case:

  • Instead of searching for elements in the whole DOM, only search in the documentElement.
  • Reject a document with a document that has more then 1 childNode.

References

For more information

If you have any questions or comments about this advisory:

Record
GHSA-crh6-fp67-6883
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-20, CWE-1288
Updated
2026-11-02
NVD 9.4

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.

Record
CVE-2022-39353
CVSS 3.1
9.4 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-20, CWE-1288
Updated
2026-11-02
OSVAZL-38671 9.8

CVE-2022-39353 affecting package python-tensorboard for versions less than 2.16.2-1

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.

Record
AZL-38671
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSV 9.4

xmldom allows multiple root nodes in a DOM

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.

Record
CVE-2022-39353
CVSS 3.1
9.4 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H
Weakness
CWE-1288, CWE-20
Updated
2026-11-02
Show 6 moreShow less
OSVDEBIAN-CVE-2022-39353 9.8

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.

Record
DEBIAN-CVE-2022-39353
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-03
OSVGHSA-crh6-fp67-6883 9.8

xmldom allows multiple root nodes in a DOM

Impact

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 https://nvd.nist.gov/vuln/detail/CVE-2022-39299 and is a potential issue for dependents.

Patches

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

Workarounds

One of the following approaches might help, depending on your use case:

  • Instead of searching for elements in the whole DOM, only search in the documentElement.
  • Reject a document with a document that has more then 1 childNode.

References

For more information

If you have any questions or comments about this advisory:

Record
GHSA-crh6-fp67-6883
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-1288, CWE-20
Updated
2026-11-02
OSVROOT-APP-NPM-CVE-2022-39353 9.8

CVE-2022-39353 in @xmldom/xmldom - Patched by Root

Root has patched CVE-2022-39353 in the @xmldom/xmldom package for Root:npm. Multiple fixed versions available.

Record
ROOT-APP-NPM-CVE-2022-39353
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-06
OSVUBUNTU-CVE-2022-39353 9.4

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.

Record
UBUNTU-CVE-2022-39353
CVSS 3.1
9.4 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVCLSA-2026-1793867503 No score

TuxCare security update for xmldom (2 CVEs)

TuxCare rebuilt xmldom to address 2 CVEs. Fixed in 0.1.31-tuxcare.8.

Record
CLSA-2026-1793867503
Updated
2026-11-05
OSVUSN-6102-1 No score

node-xmldom vulnerabilities

It was discovered that xmldom incorrectly handled certain inputs. If a user or an automated system were tricked into opening a specially crafted input file, a remote attacker could possibly use this issue to cause unexpected syntactic changes during XML processing. This issue only affected Ubuntu 20.04 LTS. (CVE-2021-21366)

It was discovered that xmldom incorrectly handled certain inputs. If a user or an automated system were tricked into opening a specially crafted input file, a remote attacker could possibly use this issue to cause a denial of service. (CVE-2022-37616, CVE-2022-39353)

Record
USN-6102-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
xmldom
npm
through 0.6.0 None known
@xmldom/xmldom
npm
before 0.7.7
0.7.7
@xmldom/xmldom
npm
0.8.0 up to 0.8.4
0.8.4
@xmldom/xmldom
npm
0.9.0-beta.1 up to 0.9.0-beta.4
0.9.0-beta.4
python-tensorboard
Azure Linux:3
before 2.16.2-1
2.16.2-1
xmldom
TuxCare:npm
From an advisory covering 2 CVEs
0.1.31-tuxcare.0 up to 0.1.31-tuxcare.8, plus listed versions
0.1.310.1.31-tuxcare.10.1.31-tuxcare.20.1.31-tuxcare.30.1.31-tuxcare.40.1.31-tuxcare.50.1.31-tuxcare.60.1.31-tuxcare.7
0.1.31-tuxcare.8
node-xmldom
Debian:12
before 0.8.6-1
0.8.6-1
node-xmldom
Debian:13
before 0.8.6-1
0.8.6-1
node-xmldom
Debian:14
before 0.8.6-1
0.8.6-1
node-xmldom
Debian:10
From an advisory covering 2 CVEs
before 0.1.27+ds-1+deb10u2, plus listed versions
0.1.27+ds-10.1.27+ds-1+deb10u1
0.1.27+ds-1+deb10u2
Show 7 moreShow less
Affected packages
PackageAffectedFixed
@xmldom/xmldom
Root:npm
before 0.7.5-aikido.2
0.7.5-aikido.2
@rootio/xmldom__xmldom
Root:npm
before 0.7.5-root.io.2
0.7.5-root.io.2
node-xmldom
Ubuntu:20.04:LTS
before 0.1.27+ds-1+deb10u2build0.20.04.1, plus listed versions
0.1.27+ds-1
0.1.27+ds-1+deb10u2build0.20.04.1
node-xmldom
Ubuntu:22.04:LTS
before 0.7.5-1ubuntu0.22.04.1, plus listed versions
0.5.0-10.7.3-10.7.5-1
0.7.5-1ubuntu0.22.04.1
node-xmldom
Ubuntu:25.10
All versions, plus listed versions
0.9.6-1
None known
node-xmldom
Ubuntu:20.04:LTS
From an advisory covering 3 CVEs
before 0.1.27+ds-1+deb10u2build0.20.04.1, plus listed versions
0.1.27+ds-1
0.1.27+ds-1+deb10u2build0.20.04.1
node-xmldom
Ubuntu:22.04:LTS
From an advisory covering 3 CVEs
before 0.7.5-1ubuntu0.22.04.1, plus listed versions
0.5.0-10.7.3-10.7.5-1
0.7.5-1ubuntu0.22.04.1

History

History
RecordedChangedSources
affected, aliasesOSV
affected
affected, aliases, factsOSV
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2022-39353 is a critical vulnerability (CVSS 9.4) in Xmldom, published November 1, 2022. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.56%, the 75th percentile. Fixed in @xmldom/xmldom 0.7.7.

References

Show 13 moreShow less
MoveEnter Open