Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2021-32796

CVE-2021-32796: Xmldom_project Xmldom XXE Vulnerability

CVE-2021-32796 is an XXE flaw in Xmldom_project Xmldom where special characters aren't properly escaped during serialization. This can cause unexpected changes in XML processing for downstream applications.

Published: March 4, 2026

CVE-2021-32796 Overview

CVE-2021-32796 is an Improper Output Encoding vulnerability in the xmldom JavaScript library, an open source pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module. The vulnerability exists in xmldom versions 0.6.0 and older, where the library does not correctly escape special characters when serializing elements removed from their ancestor. This encoding flaw may lead to unexpected syntactic changes during XML processing in downstream applications.

Critical Impact

Applications using vulnerable xmldom versions may be susceptible to XML injection attacks where maliciously crafted documents can alter the structure of serialized XML output, potentially bypassing security controls or manipulating application logic.

Affected Products

  • xmldom versions 0.6.0 and earlier
  • Node.js applications utilizing vulnerable xmldom package versions
  • Downstream applications that process XML using xmldom serialization

Discovery Timeline

  • 2021-07-27 - CVE-2021-32796 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-32796

Vulnerability Analysis

The vulnerability stems from improper output encoding when the xmldom library serializes XML elements that have been removed from their parent nodes. When an element is detached from its ancestor and subsequently serialized, special characters such as <, &, and " are not properly escaped in attribute values. This improper encoding violates the W3C XML specification, specifically the "Well-formed constraint: No < in Attribute Values" requirement.

The root cause relates to CWE-116 (Improper Encoding or Escaping of Output) and CWE-91 (XML Injection). When special characters bypass encoding during serialization, the resulting XML output may contain syntactically significant characters in unexpected locations, fundamentally altering the document structure.

Root Cause

The serialization function in xmldom failed to apply proper character encoding when generating attribute values for elements removed from their DOM tree. The addSerializedAttribute function did not consistently replace special XML characters (<, &, ") with their corresponding entity references (<, &, ") before inserting them into the output buffer.

Attack Vector

An attacker can exploit this vulnerability by crafting a malicious XML document containing special characters in strategic locations. When this document is parsed by an application using vulnerable xmldom versions, and elements are removed from their ancestor before serialization, the special characters will pass through without proper encoding. This can result in:

  • XML injection attacks that alter document structure
  • Bypass of XML-based security controls (such as XML signature validation)
  • Data integrity violations in XML processing pipelines
  • Potential for exploitation in SAML, SOAP, or other XML-based protocols
javascript
// Security patch from lib/dom.js - Merge pull request from GHSA-5fg8-2547-mr8q
 	}
 	return true;
 }
+/**
+ * Well-formed constraint: No < in Attribute Values
+ * The replacement text of any entity referred to directly or indirectly in an attribute value must not contain a <.
+ * @see https://www.w3.org/TR/xml/#CleanAttrVals
+ * @see https://www.w3.org/TR/xml/#NT-AttValue
+ */
+function addSerializedAttribute(buf, qualifiedName, value) {
+	buf.push(' ', qualifiedName, '="', value.replace(/[<&"]/g,_xmlEncoder), '"')
+}
 
function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){
 	if (!visibleNamespaces) {

Source: GitHub Commit Update

Detection Methods for CVE-2021-32796

Indicators of Compromise

  • Presence of xmldom package versions 0.6.0 or earlier in package.json or package-lock.json
  • XML output containing unescaped <, &, or " characters within attribute values
  • Application logs showing XML parsing errors after serialization round-trips
  • Unexpected XML structure changes in downstream processing systems

Detection Strategies

  • Audit Node.js dependencies using npm audit or yarn audit to identify vulnerable xmldom versions
  • Implement software composition analysis (SCA) scanning in CI/CD pipelines to detect vulnerable packages
  • Monitor for XML validation errors that may indicate malformed serialization output
  • Review application code for patterns where DOM elements are removed from ancestors before serialization

Monitoring Recommendations

  • Enable verbose logging for XML parsing and serialization operations in applications using xmldom
  • Implement XML schema validation on serialized output to detect structural anomalies
  • Set up dependency vulnerability scanning alerts for the xmldom package
  • Monitor for security advisories from the xmldom project via GitHub Security Advisories

How to Mitigate CVE-2021-32796

Immediate Actions Required

  • Upgrade xmldom to version 0.7.0 or later immediately
  • Run npm update xmldom or yarn upgrade xmldom to update the package
  • Verify the update by checking package-lock.json or yarn.lock for the new version
  • Test XML serialization functionality after upgrade to ensure compatibility

Patch Information

The vulnerability has been resolved in xmldom version 0.7.0. The fix introduces a new addSerializedAttribute function that properly escapes special characters (<, &, ") using the _xmlEncoder function before including them in serialized attribute values. This ensures compliance with the W3C XML specification's "Well-formed constraint: No < in Attribute Values" requirement.

The security fix is available in the GitHub commit. For additional context, review the GitHub Security Advisory GHSA-5fg8-2547-mr8q.

Workarounds

  • Implement input validation to reject XML documents containing potentially malicious character sequences in attribute values
  • Add post-serialization validation to verify XML output is well-formed before passing to downstream systems
  • Avoid removing elements from their ancestor nodes before serialization when using vulnerable versions
  • Consider using alternative XML parsing libraries if immediate upgrade is not feasible
bash
# Configuration example
# Upgrade xmldom to patched version
npm install xmldom@0.7.0

# Verify installed version
npm list xmldom

# Alternative: Use yarn
yarn upgrade xmldom@0.7.0

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeXXE

  • Vendor/TechXmldom

  • SeverityMEDIUM

  • CVSS Score5.3

  • EPSS Probability0.49%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-116

  • CWE-91
  • Technical References
  • GitHub Security Advisory

  • Mattermost Blog Post
  • Vendor Resources
  • GitHub Commit Update
  • Related CVEs
  • CVE-2026-34601: xmldom XML Injection Vulnerability

  • CVE-2022-39353: Xmldom_project Xmldom XXE Vulnerability

  • CVE-2021-21366: Xmldom_project Xmldom XXE Vulnerability

  • CVE-2022-37616: Xmldom Prototype Pollution Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English