Quick answers
- Is CVE-2021-32796 exploited in the wild?
- No. Junglewise Threat Intelligence has no report of CVE-2021-32796 being exploited in the wild.
- How severe is CVE-2021-32796?
- Low severity, with a CVSS score of 3.1, published 3 August 2021.
- Which products and versions are affected?
- @xmldom/xmldom (npm) SEMVER:introduced=0,fixed=0.7.0; xmldom (npm) SEMVER:introduced=0,last_affected=0.6.0.
- Is there a fix for CVE-2021-32796?
- Yes. @xmldom/xmldom (npm): upgrade to 0.7.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
- How is CVE-2021-32796 attacked?
- It is attacked over the network, in a software library.
- Am I affected by CVE-2021-32796?
- Check whether you run @xmldom/xmldom (npm) or xmldom (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.
How to fix
- @xmldom/xmldom (npm): upgrade to 0.7.0 or later
npm install @xmldom/xmldom@0.7.0
Technical details
This vulnerability is a character-escaping bug (CWE-116) in xmldom's XML serialization logic. When an XML element is removed from its ancestor document and then serialized, special characters in the element and its descendants are not correctly escaped in the output. This causes the serialized XML to have different semantics than the original—a round-trip parse-serialize-parse cycle can result in a structurally different document tree. The vulnerability affects all versions up to 0.6.0. Exploitation requires no authentication and is triggered by parsing maliciously crafted XML documents. The practical impact mirrors similar vulnerabilities discovered in Go's encoding/xml, REXML, and others: applications that rely on XML integrity for security decisions (especially SAML SSO) can have their trust model broken by silent XML mutation. The vulnerability is fixed in @xmldom/xmldom version 0.7.0 and later; the original xmldom package on npm is no longer maintained.
Affected products
- xmldom xmldom <=0.6.0
- xmldom @xmldom/xmldom <0.7.0
Identifiers
- CVE-2021-32796
- GHSA-5fg8-2547-mr8q
Timeline
- 2021-07-27: disclosed
- 2021-08-03: advisory
- 2021-08-02: patched: @xmldom/xmldom version 0.7.0 released
References
- https://github.com/xmldom/xmldom/security/advisories/GHSA-5fg8-2547-mr8q
- https://github.com/xmldom/xmldom/commit/7b4b743917a892d407356e055b296dcd6d107e8b
- https://github.com/xmldom/xmldom
- https://mattermost.com/blog/coordinated-disclosure-go-xml-vulnerabilities
- https://mattermost.com/blog/securing-xml-implementations-across-the-web
- https://www.npmjs.com/package/@xmldom/xmldom