CVEfocus › CVE database › CVE-2022-39353

CVE-2022-39353xmldom allows multiple root nodes in a DOM

CVSS 9.4 CriticalEPSS 1.7% (higher than 78% of CVEs)Published 2022-11-02Updated 2025-04-22Assigner: GitHub_M

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

CWE-1288CWE-20

What to do

Fixed builds are available from Debian, Ubuntu, npm: see the table below for the fixed version per release.

npm has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

6Fixed
1Fix pending
1Will not fix
2Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.04node-xmldomNot affected
vulnerable_code_not_present
Ubuntu 25.10node-xmldomWill not fix
Ubuntu decided not to fix this in this release
UBUNTU-CVE-2022-39353
Ubuntu 24.04node-xmldomNot affected
vulnerable_code_not_present
Ubuntu 22.04node-xmldomFixed0.7.5-1ubuntu0.22.04.1UBUNTU-CVE-2022-39353
Ubuntu 20.04node-xmldomFixed0.1.27+ds-1+deb10u2build0.20.04.1UBUNTU-CVE-2022-39353
Debian 14node-xmldomFixed0.8.6-1DEBIAN-CVE-2022-39353
Debian 13node-xmldomFixed0.8.6-1DEBIAN-CVE-2022-39353
Debian 12node-xmldomFixed0.8.6-1DEBIAN-CVE-2022-39353
npm library@xmldom/xmldomFixed0.7.7GHSA-crh6-fp67-6883
npm libraryxmldomFix pendingGHSA-crh6-fp67-6883

What the vendor says

As published in the CVE record by GitHub_M, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.