CVE-2021-32796: Misinterpretation of malicious XML input in xmldom
Impact 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.
Patches Update to one of the fixed versions of @xmldom/xmldom (>=0.7.0)
See issue #271 for the status of publishing xmldom to npm or join #270 for Q&A/discussion until it's resolved.
Workarounds
Downstream applications can validate the input and reject the maliciously crafted documents.
References
Similar to this one reported on the Go standard library:
- https://mattermost.com/blog/coordinated-disclosure-go-xml-vulnerabilities/ - https://mattermost.com/blog/securing-xml-implementations-across-the-web/
For more information
If you have any questions or comments about this advisory:
Open an issue in xmldom/xmldom Email us: send an email to all addresses that are shown by npm owner ls @xmldom/xmldom
Other sources
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.
— MITRE
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2021-32796?
CVE-2021-32796 is considered a medium severity vulnerability due to potential XML processing issues.
How do I fix CVE-2021-32796?
To fix CVE-2021-32796, update the xmldom package to version 0.7.0 or higher.
Which versions of xmldom are affected by CVE-2021-32796?
CVE-2021-32796 affects xmldom versions 0.6.0 and older.
What are the potential consequences of CVE-2021-32796?
The consequences of CVE-2021-32796 may include unexpected syntactic changes during XML processing.
Is there a workaround for CVE-2021-32796 if I cannot update?
Currently, the recommended approach is to update to a fixed version rather than relying on a workaround.