xmldom allows multiple root nodes in a DOM
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- —
- Confidentiality · integrity · availability
- High · High · High
- Fix status
- Fixed
Attack profile from CVSS 3.1 · NVD. Fix status from CNA and GitHub.
Summary
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`.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| xmldom | xmldom | up to 0.6.0; before 0.7.7; 0.8.0 to before 0.8.4; 0.9.0-beta.1 to before 0.9.0-beta.4 | 0.7.7, 0.8.4, 0.9.0-beta.4 | Patch available | CNA |
| — | xmldom (npm) | up to 0.6.0 | — | No fix listed | GHSA-crh6-fp67-6883 |
| — | @xmldom/xmldom (npm) | before 0.7.7 | 0.7.7 | Patch available | GHSA-crh6-fp67-6883 |
| — | @xmldom/xmldom (npm) | 0.8.0 to before 0.8.4 | 0.8.4 | Patch available | GHSA-crh6-fp67-6883 |
| — | @xmldom/xmldom (npm) | 0.9.0-beta.1 to before 0.9.0-beta.4 | 0.9.0-beta.4 | Patch available | GHSA-crh6-fp67-6883 |
- xmldom Vendorxmldom Affected up to 0.6.0; before 0.7.7; 0.8.0 to before 0.8.4; 0.9.0-beta.1 to before 0.9.0-beta.4 Fixed in 0.7.7, 0.8.4, 0.9.0-beta.4 Patch available CNA
- xmldom (npm) Vendor— Affected up to 0.6.0 Fixed in — No fix listed GHSA-crh6-fp67-6883
- @xmldom/xmldom (npm) Vendor— Affected before 0.7.7 Fixed in 0.7.7 Patch available GHSA-crh6-fp67-6883
- @xmldom/xmldom (npm) Vendor— Affected 0.8.0 to before 0.8.4 Fixed in 0.8.4 Patch available GHSA-crh6-fp67-6883
- @xmldom/xmldom (npm) Vendor— Affected 0.9.0-beta.1 to before 0.9.0-beta.4 Fixed in 0.9.0-beta.4 Patch available GHSA-crh6-fp67-6883
CPE configurations NVD · 5
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:xmldom_project:xmldom:*:*:*:*:*:node.js:*:* | before 0.6.0; 0.7.0 to before 0.7.7; 0.8.0 to before 0.8.4 | Vulnerable | xmldom |
| cpe:2.3:a:xmldom_project:xmldom:0.9.0:beta1:*:*:*:node.js:*:* | 0.9.0 beta1 | Vulnerable | xmldom |
| cpe:2.3:a:xmldom_project:xmldom:0.9.0:beta2:*:*:*:node.js:*:* | 0.9.0 beta2 | Vulnerable | xmldom |
| cpe:2.3:a:xmldom_project:xmldom:0.9.0:beta3:*:*:*:node.js:*:* | 0.9.0 beta3 | Vulnerable | xmldom |
| cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* | 10.0 | Vulnerable | Debian |
- cpe:2.3:a:xmldom_project:xmldom:*:*:*:*:*:node.js:*:* Versions before 0.6.0; 0.7.0 to before 0.7.7; 0.8.0 to before 0.8.4 Vulnerable ·xmldom
- cpe:2.3:a:xmldom_project:xmldom:0.9.0:beta1:*:*:*:node.js:*:* Versions 0.9.0 beta1 Vulnerable ·xmldom
- cpe:2.3:a:xmldom_project:xmldom:0.9.0:beta2:*:*:*:node.js:*:* Versions 0.9.0 beta2 Vulnerable ·xmldom
- cpe:2.3:a:xmldom_project:xmldom:0.9.0:beta3:*:*:*:node.js:*:* Versions 0.9.0 beta3 Vulnerable ·xmldom
- cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:* Versions 10.0 Vulnerable ·Debian
Remediation
- Fix · CNA xmldom (xmldom) Fixed in 0.7.7, 0.8.4, 0.9.0-beta.4
- Fix · GHSA-crh6-fp67-6883 @xmldom/xmldom (npm) Fixed in 0.7.7 Advisory →
- Fix · GHSA-crh6-fp67-6883 @xmldom/xmldom (npm) Fixed in 0.8.4 Advisory →
- Fix · GHSA-crh6-fp67-6883 @xmldom/xmldom (npm) Fixed in 0.9.0-beta.4 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Important. Red Hat's page for this CVE →
Not affected: 2 products
- Red Hat OpenShift Container Platform 3.11
- Red Hat OpenShift Container Platform 4
Timeline
- 2026-10-02 Threatist record created from CVE-2022-39353
- 2026-10-03 Alias added: GHSA-crh6-fp67-6883
References
Advisory 3
Other 7
- https://github.com/xmldom/xmldom/commit/52a708360c35aa160fcca8621720d71fd0f95f1a
- https://github.com/xmldom/xmldom/commit/7ff7c10ab2961703ac1752e95b4ff60ee4ee6643
- https://github.com/xmldom/xmldom/commit/c02f786216bed70825f9a351c65e61500f51e931
- https://github.com/xmldom/xmldom
- https://github.com/xmldom/xmldom/releases/tag/0.7.7
- https://github.com/xmldom/xmldom/releases/tag/0.8.4
- https://github.com/xmldom/xmldom/releases/tag/0.9.0-beta.4
More Xmldom vulnerabilities
- TI-2022-17521 A prototype pollution vulnerability exists in the function copy in dom.js in the xmldom… CVSS 3.1CRITICAL 9.8
- TI-2021-12462 Misinterpretation of malicious XML input in xmldom CVSS 3.1MEDIUM 6.5
- TI-2021-04465 Misinterpretation of malicious XML input CVSS 3.1MEDIUM 4.3
Sources
- CVE-2022-39353 · CVE Program
- CVE-2022-39353 · NVD
- FIRST EPSS
- GHSA-crh6-fp67-6883 · GitHub Advisory Database · CC BY 4.0
- CVE-2022-39353 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences