{"id":"CVE-2021-32796","aliases":["CVE-2021-32796","GHSA-5fg8-2547-mr8q"],"related":[],"kind":"vulnerability","state":"published","title":"Misinterpretation of malicious XML input in xmldom","summary":"xmldom is an open source pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. xmldom versions 0.6.0 and older do not correctly escape special characters when serializing elements removed from their ancestor. This may lead to unexpected syntactic changes during XML processing in some downstream applications. This issue has been resolved in version 0.7.0. As a workaround downstream applications can validate the input and reject the maliciously crafted documents.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"xmldom is an open source pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. xmldom versions 0.6.0 and older do not correctly escape special characters when serializing elements removed from their ancestor. This may lead to unexpected syntactic changes during XML processing in some downstream applications. This issue has been resolved in version 0.7.0. As a workaround downstream applications can validate the input and reject the maliciously crafted documents.","source":"cvelist"},{"lang":"en","text":"### Impact\nxmldom versions 0.6.0 and older do not correctly escape special characters when serializing elements removed from their ancestor. This may lead to unexpected syntactic changes during XML processing in some downstream applications.\n\n### Patches\nUpdate to one of the fixed versions of `@xmldom/xmldom` (`>=0.7.0`)\n\nSee issue #271 for the status of publishing `xmldom` to npm or join #270 for Q&A/discussion until it's resolved.\n\n### Workarounds\n\nDownstream applications can validate the input and reject the maliciously crafted documents.\n\n### References\n\nSimilar to this one reported on the Go standard library:\n\n- https://mattermost.com/blog/coordinated-disclosure-go-xml-vulnerabilities/\n- https://mattermost.com/blog/securing-xml-implementations-across-the-web/\n\n### For more information\n\nIf you have any questions or comments about this advisory:\n\n* Open an issue in [`xmldom/xmldom`](https://github.com/xmldom/xmldom)\n* Email us: send an email to **all** addresses that are shown by `npm owner ls @xmldom/xmldom`","format":"markdown","source":"ghsa"},{"lang":"es","text":"xmldom es un módulo DOMParser y XMLSerializer de código abierto basado en el estándar W3C (XML DOM Level 2 Core). Las versiones 0.6.0 y anteriores de xmldom no escapan correctamente los caracteres especiales al serializar elementos eliminados de su ancestro. Esto puede provocar cambios sintácticos inesperados durante el procesamiento de XML en algunas aplicaciones posteriores. Este problema se ha resuelto en la versión 0.7.0. Como solución, las aplicaciones posteriores pueden validar la entrada y rechazar los documentos maliciosos","source":"nvd"}],"published":"2021-07-27T21:45:13.000Z","modified":"2026-09-10T03:49:15.589Z","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:L/A:N","score":6.5,"rating":"MEDIUM"},"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:L/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N","score":5.3,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:L/Au:N/C:N/I:P/A:N","score":5,"rating":"MEDIUM"}],"cwes":["CWE-91","CWE-116"],"affected":[{"ranges":[{"version":"< 0.7.0","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.0"}],"ecosystem":"npm","package":"@xmldom/xmldom","purl":"pkg:npm/%40xmldom/xmldom","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.7.0"}],"vendor":"xmldom_project","product":"xmldom","cpe":"cpe:2.3:a:xmldom_project:xmldom:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://mattermost.com/blog/coordinated-disclosure-go-xml-vulnerabilities/","tags":["not-applicable","third-party-advisory","x-refsource-misc","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://github.com/xmldom/xmldom/security/advisories/GHSA-5fg8-2547-mr8q","tags":["third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/xmldom/xmldom/commit/7b4b743917a892d407356e055b296dcd6d107e8b","tags":["patch","third-party-advisory","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-32796","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/xmldom/xmldom","tags":["package"],"sources":["ghsa"]},{"url":"https://mattermost.com/blog/coordinated-disclosure-go-xml-vulnerabilities","tags":["web"],"sources":["ghsa"]},{"url":"https://mattermost.com/blog/securing-xml-implementations-across-the-web","tags":["web"],"sources":["ghsa"]},{"url":"https://www.npmjs.com/package/@xmldom/xmldom","tags":["web"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-32796","url":"https://www.cve.org/CVERecord?id=CVE-2021-32796","licence":"CVE Terms of Use","modified":"2024-08-03T23:33:55.989Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-5fg8-2547-mr8q","url":"https://github.com/advisories/GHSA-5fg8-2547-mr8q","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:15.589Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-32796","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-32796","licence":"Public domain","modified":"2026-06-17T03:53:38.860Z"}],"updatedAt":"2026-11-25T22:58:02.878Z","epss":{"score":0.01358,"percentile":0.72478,"date":"2026-12-01T12:00:22.000Z"}}