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

Critical 9.4 Published Updated

The xmldom library incorrectly parses XML with multiple root nodes, potentially causing logic errors in dependent applications that assume a single root.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2022-39353?

CVE-2022-39353 is a critical vulnerability in Debian Debian Linux, published on 2 Nov 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.

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

Weakness: CWE-20, CWE-1288

Which versions are affected by CVE-2022-39353?

8 open source packages ship an affected version, including @xmldom/xmldom and xmldom. It affects 2 products.

PackageAffectedFixed in
@xmldom/xmldom npmAll versions0.7.7
@xmldom/xmldom npmAll versions0.7.7
@xmldom/xmldom npmFrom 0.8.00.8.4
@xmldom/xmldom npmFrom 0.8.00.8.4
@xmldom/xmldom npmFrom 0.9.0-beta.10.9.0-beta.4
@xmldom/xmldom npmFrom 0.9.0-beta.10.9.0-beta.4
2 more packages
xmldom npmAll versions to 0.6.0None
xmldom npmAll versions to 0.6.0None

Products include Debian Debian Linux, Xmldom Project Xmldom.

How do I fix CVE-2022-39353?

Upgrade @xmldom/xmldom to a fixed version for your release line: 0.7.7, 0.8.4 or 0.9.0-beta.4.

Is CVE-2022-39353 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-39353 exists.

All Debian Debian Linux vulnerabilities

Sources

Also known as AZL-38671, DEBIAN-CVE-2022-39353, GHSA-crh6-fp67-6883, UBUNTU-CVE-2022-39353.

Is CVE-2022-39353 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free