Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS1jcmg2LWZwNjctNjg4M84AAvn0

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:

References

For more information

If you have any questions or comments about this advisory:

Permalink: https://github.com/advisories/GHSA-crh6-fp67-6883
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1jcmg2LWZwNjctNjg4M84AAvn0
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Critical
Classification: General
Published: over 1 year ago
Updated: about 1 year ago


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

Identifiers: GHSA-crh6-fp67-6883, CVE-2022-39353
References: Repository: https://github.com/xmldom/xmldom
Blast Radius: 55.2

Affected Packages

npm:@xmldom/xmldom
Dependent packages: 605
Dependent repositories: 85,555
Downloads: 30,200,534 last month
Affected Version Ranges: >= 0.9.0-beta.1, < 0.9.0-beta.4, >= 0.8.0, < 0.8.4, < 0.7.7
Fixed in: 0.9.0-beta.4, 0.8.4, 0.7.7
All affected versions: 0.7.0, 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
All unaffected versions: 0.7.7, 0.7.8, 0.7.9, 0.7.10, 0.7.11, 0.7.12, 0.7.13, 0.8.4, 0.8.5, 0.8.6, 0.8.7, 0.8.8, 0.8.9, 0.8.10
npm:xmldom
Dependent packages: 2,788
Dependent repositories: 424,390
Downloads: 6,474,830 last month
Affected Version Ranges: <= 0.6.0
No known fixed version
All affected versions: 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.1.6, 0.1.7, 0.1.8, 0.1.9, 0.1.10, 0.1.11, 0.1.12, 0.1.13, 0.1.14, 0.1.15, 0.1.16, 0.1.17, 0.1.18, 0.1.19, 0.1.20, 0.1.21, 0.1.22, 0.1.24, 0.1.25, 0.1.26, 0.1.27, 0.1.29, 0.1.30, 0.1.31, 0.2.0, 0.2.1, 0.3.0, 0.4.0, 0.5.0, 0.6.0