CVE-2022-39353
xmldom allows multiple root nodes in a DOM
Reported by github_m · Published November 2, 2022
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`.
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| xmldom | xmldom | <= 0.6.0, < 0.7.7, >= 0.8.0, < 0.8.4 |
| xmldom | xmldom | 0, 0.9.0-beta.1, 0.8.0 |
| xmldom | xmldom | 0.9.0, 0, 0.8.0 |
| chainguard | wazuh-dashboard-fips | 0 |
| chainguard | wazuh-dashboard | 0 |
| npm | xmldom | 0.9.0, 0.8.0, 0 |
Timeline
- Nov 1, 2022 CVE Published
- Nov 3, 2022 EPSS Score (30 in total, the first dated here)
- Nov 21, 2024 CVE Updated
- Mar 9, 2026 Security Advisory
- Jun 17, 2026 Coalition ESS Score
- Nov 6, 2026 PoC Published
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2022-39353
vulnetix vdb fixes CVE-2022-39353
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2022-39353/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- [debian-lts-announce] 20230101 [SECURITY] [DLA 3260-1] node-xmldom security update mailing-list
- https://nvd.nist.gov/vuln/detail/CVE-2022-39353 advisory
- https://github.com/xmldom/xmldom/releases/tag/0.7.7 url
- https://github.com/xmldom/xmldom/releases/tag/0.8.4 url
- https://github.com/xmldom/xmldom/releases/tag/0.9.0-beta.4 url
- https://github.com/advisories/GHSA-crh6-fp67-6883 advisory