Loading...
Skip to main content

CVE-2022-39353 — xmldom allows multiple root nodes in...

CRITICAL

xmldom allows multiple root nodes in a DOM

Published November 1, 2022Updated September 10, 2026Source: osv

Summary

### 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 - https://nvd.nist.gov/vuln/detail/CVE-2022-39299 - https://github.com/jindw/xmldom/issues/150 ### For more information If you have any questions or comments about this advisory: * Email us at security@xmldom.org

Advisory Timeline

  • First published November 1, 2022 (1441 days ago).
  • Last revised September 10, 2026 — 1408 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

npm
Update @xmldom/xmldom to 0.8.4 or later
npm install @xmldom/xmldom@0.8.4
npm
Update @xmldom/xmldom to 0.7.7 or later
npm install @xmldom/xmldom@0.7.7
npm
Update @xmldom/xmldom to 0.9.0-beta.4 or later
npm install @xmldom/xmldom@0.9.0-beta.4

After upgrading, run your dependency scanner again to confirm the vulnerability is resolved.

Affected Packages (4)

Affects 1 ecosystem: npm (2).

PackageEcosystemAffectedFixed In
@xmldom/xmldom
npm
All versions0.8.4
xmldom
npm
All versionsRange-based data available
@xmldom/xmldom
npm
All versions0.7.7
@xmldom/xmldom
npm
All versions0.9.0-beta.4

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Frequently Asked Questions

What is CVE-2022-39353?
xmldom allows multiple root nodes in a DOM This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.8/10).
How do I check if my project is affected by CVE-2022-39353?
CVE-2022-39353 affects @xmldom/xmldom and xmldom. Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2022-39353 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.8

Exploitation is straightforward and causes maximum impact. Patch immediately.

Also Known As

GHSA-crh6-fp67-6883

Related CVEs

  • CVE-2026-107722
    CRITICAL

    fast-jwt: Incomplete patch of CVE-2026-34950: Non-whitespace key-prefix re-enables RSA→HS256 algorithm confusion

  • CVE-2026-108261
    CRITICAL

    TinaCMS admin preview iframe loads an attacker-controlled origin from the URL fragment

Check if you're affected

Scan your dependencies to see if this vulnerability affects your projects.

Scan Your Dependencies