{"id":"CVE-2022-39353","aliases":["CVE-2022-39353","GHSA-crh6-fp67-6883"],"related":[],"kind":"vulnerability","state":"published","title":"xmldom allows multiple root nodes in a DOM","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`.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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`.","source":"cvelist"},{"lang":"en","text":"### Impact\nxmldom 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.\nThis 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.\n\n### Patches\nUpdate 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`).\n\n### Workarounds\nOne of the following approaches might help, depending on your use case:\n- Instead of searching for elements in the whole DOM, only search in the `documentElement`.\n- Reject a document with a document that has more then 1 `childNode`.\n\n### References\n- https://nvd.nist.gov/vuln/detail/CVE-2022-39299\n- https://github.com/jindw/xmldom/issues/150\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Email us at security@xmldom.org","format":"markdown","source":"ghsa"},{"lang":"es","text":"xmldom es un módulo `DOMParser` y `XMLSerializer` basado en el estándar W3C de JavaScript puro (XML DOM Level 2 Core). xmldom analiza XML que no está bien formado porque contiene múltiples elementos de nivel superior y agrega todos los nodos raíz a la colección `childNodes` del `Documento`, sin informar ningún error ni arrojar. Esto rompe la suposición de que solo hay un nodo raíz en el árbol, lo que llevó a la emisión de CVE-2022-39299, ya que es un problema potencial para los dependientes. Actualice a @xmldom/xmldom@~0.7.7, @xmldom/xmldom@~0.8.4 (dist-tag más reciente) o @xmldom/xmldom@&gt;=0.9.0-beta.4 (dist-tag siguiente). Como workaround, utilice uno de los siguientes enfoques según su caso de uso: en lugar de buscar elementos en todo el DOM, solo busque en `documentElement` o rechace un documento con un documento que tenga más de 1 `childNode`.","source":"nvd"}],"published":"2022-11-01T17:29:11.000Z","modified":"2026-09-10T03:49:47.098Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H","score":9.4,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:H","score":9.4,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-20","CWE-1288"],"affected":[{"ranges":[{"version":"<= 0.6.0","status":"affected"},{"version":"< 0.7.7","status":"affected"},{"version":">= 0.8.0, < 0.8.4","status":"affected"},{"version":">= 0.9.0-beta.1, < 0.9.0-beta.4","status":"affected"}],"vendor":"xmldom","product":"xmldom","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"0.6.0"}],"ecosystem":"npm","package":"xmldom","purl":"pkg:npm/xmldom","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.7.7"}],"ecosystem":"npm","package":"@xmldom/xmldom","purl":"pkg:npm/%40xmldom/xmldom","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.8.0","status":"affected","fixed":"0.8.4"}],"ecosystem":"npm","package":"@xmldom/xmldom","purl":"pkg:npm/%40xmldom/xmldom","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.9.0-beta.1","status":"affected","fixed":"0.9.0-beta.4"}],"ecosystem":"npm","package":"@xmldom/xmldom","purl":"pkg:npm/%40xmldom/xmldom","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.6.0"},{"status":"affected","introduced":"0.7.0","fixed":"0.7.7"},{"status":"affected","introduced":"0.8.0","fixed":"0.8.4"},{"status":"affected","version":"0.9.0"},{"status":"affected","version":"0.9.0"},{"status":"affected","version":"0.9.0"}],"vendor":"xmldom_project","product":"xmldom","cpe":"cpe:2.3:a:xmldom_project:xmldom:*:*:*:*:*:node.js:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"10.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/xmldom/xmldom/security/advisories/GHSA-crh6-fp67-6883","tags":["third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/jindw/xmldom/issues/150","tags":["exploit","issue-tracking","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2023/01/msg00000.html","tags":["mailing-list","third-party-advisory","web","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-39353","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/xmldom/xmldom/commit/52a708360c35aa160fcca8621720d71fd0f95f1a","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/xmldom/xmldom/commit/7ff7c10ab2961703ac1752e95b4ff60ee4ee6643","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/xmldom/xmldom/commit/c02f786216bed70825f9a351c65e61500f51e931","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/xmldom/xmldom","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/xmldom/xmldom/releases/tag/0.7.7","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/xmldom/xmldom/releases/tag/0.8.4","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/xmldom/xmldom/releases/tag/0.9.0-beta.4","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2025-04-22T15:39:20.618Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2022-39353","url":"https://www.cve.org/CVERecord?id=CVE-2022-39353","licence":"CVE Terms of Use","modified":"2025-04-22T17:16:38.092Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-crh6-fp67-6883","url":"https://github.com/advisories/GHSA-crh6-fp67-6883","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:47.098Z"},{"source":"nvd","name":"NVD","id":"CVE-2022-39353","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-39353","licence":"Public domain","modified":"2026-06-17T04:58:12.050Z"}],"updatedAt":"2026-11-25T22:58:16.186Z","epss":{"score":0.01559,"percentile":0.7595,"date":"2026-12-01T12:00:22.000Z"}}