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-45960

CVE-2021-45960: Libexpat Buffer Overflow Vulnerability

CVE-2021-45960 is a buffer overflow flaw in Libexpat before version 2.4.3 caused by improper left shift operations in storeAtts function. This article covers technical details, affected versions, and mitigation.

Published: February 25, 2026

CVE-2021-45960 Overview

CVE-2021-45960 is an integer overflow vulnerability in Expat (also known as libexpat), a widely-used XML parsing library. The vulnerability exists in versions prior to 2.4.3 and occurs in the storeAtts function within xmlparse.c. A left shift operation by 29 or more places can lead to realloc misbehavior, resulting in improper memory allocation—either allocating too few bytes or only freeing memory without proper reallocation.

This vulnerability can be exploited remotely over the network by an authenticated attacker without user interaction. Given that libexpat is a foundational XML parsing library used across numerous applications and systems, the potential impact is widespread. Successful exploitation could lead to memory corruption, application crashes, or potentially arbitrary code execution.

Critical Impact

Memory corruption via integer overflow in XML parsing library could affect confidentiality, integrity, and availability of affected systems across multiple vendors and platforms.

Affected Products

  • libexpat_project libexpat (versions before 2.4.3)
  • Tenable Nessus
  • Debian debian_linux (10.0 and 11.0)
  • Siemens sinema_remote_connect_server
  • NetApp active_iq_unified_manager
  • NetApp hci_baseboard_management_controller (H610C, H610S, H615C)
  • NetApp oncommand_workflow_automation
  • NetApp solidfire & hci_management_node

Discovery Timeline

  • 2022-01-01 - CVE-2021-45960 published to NVD
  • 2025-05-05 - Last updated in NVD database

Technical Details for CVE-2021-45960

Vulnerability Analysis

The vulnerability resides in the storeAtts function within xmlparse.c, the core XML parsing component of libexpat. When processing XML attributes, the function performs a left shift operation that, under certain conditions, can shift by 29 or more bit positions. This arithmetic operation triggers undefined behavior in C, as left-shifting by a value greater than or equal to the width of the operand type leads to unpredictable results.

The integer overflow directly affects memory allocation logic. When realloc is called with an incorrectly calculated size value resulting from the overflow, it may allocate a buffer that is significantly smaller than required or may only free memory without performing proper reallocation. This creates conditions for heap corruption, buffer overflows, or use-after-free scenarios depending on how the application subsequently uses the affected memory regions.

The vulnerability is classified under CWE-682 (Incorrect Calculation), highlighting that the root cause is improper arithmetic handling rather than traditional input validation failures.

Root Cause

The root cause is an incorrect calculation (CWE-682) in the storeAtts function where a left shift operation by 29 or more places occurs during attribute processing. In C, left-shifting a 32-bit integer by 29 or more positions results in undefined behavior when the value being shifted has certain bit patterns set. This undefined behavior manifests as an incorrect size calculation that is subsequently passed to realloc, causing the memory allocator to behave unexpectedly.

The calculation flaw exists because the code did not properly validate or constrain the shift amount before performing the operation, nor did it account for potential integer overflow conditions when computing memory sizes for attribute storage.

Attack Vector

The attack vector is network-based, requiring low privileges but no user interaction. An attacker can exploit this vulnerability by sending specially crafted XML documents to applications using vulnerable versions of libexpat. The malicious XML would contain attributes designed to trigger the problematic left shift operation during parsing.

When the vulnerable storeAtts function processes these crafted attributes, the integer overflow occurs, leading to memory allocation issues. Depending on the application's memory layout and subsequent operations, this could result in denial of service through application crashes, information disclosure through memory corruption, or potentially code execution if the attacker can control memory contents through heap manipulation techniques.

Detection Methods for CVE-2021-45960

Indicators of Compromise

  • Unexpected application crashes during XML parsing operations, particularly when processing documents with numerous or specially crafted attributes
  • Memory allocation errors or segmentation faults in processes utilizing libexpat
  • Abnormal memory consumption patterns in XML processing applications
  • Application logs showing realloc failures or memory corruption errors

Detection Strategies

  • Implement binary composition analysis to identify applications bundling vulnerable libexpat versions (prior to 2.4.3)
  • Deploy application performance monitoring to detect abnormal memory allocation patterns during XML processing
  • Use memory sanitizers (AddressSanitizer, Valgrind) in development and testing environments to identify heap corruption issues
  • Monitor for crash dumps indicating memory corruption in XML parsing routines

Monitoring Recommendations

  • Enable detailed logging for XML parsing operations in production applications
  • Monitor system logs for segmentation faults, heap corruption, or unexpected termination of processes known to use libexpat
  • Implement alerting for repeated application restarts that may indicate exploitation attempts
  • Track software inventory to maintain awareness of libexpat versions deployed across the environment

How to Mitigate CVE-2021-45960

Immediate Actions Required

  • Identify all applications and systems using libexpat versions prior to 2.4.3 through software composition analysis
  • Upgrade libexpat to version 2.4.3 or later where the integer overflow has been corrected
  • Apply vendor-specific patches from Debian, NetApp, Siemens, Tenable, and other affected vendors
  • Prioritize patching for internet-facing applications that process untrusted XML content

Patch Information

The vulnerability has been addressed in libexpat version 2.4.3. The fix is available via GitHub Pull Request #534, which corrects the improper calculation in the storeAtts function. Multiple downstream vendors have released security advisories with patches:

  • Debian Security Advisory DSA-5073
  • Tenable Security Notification TNS-2022-05
  • NetApp Security Advisory NTAP-20220121-0004
  • Siemens Product Security Advisory SSA-484086
  • Gentoo GLSA 2022-09-24

For technical details about the vulnerability, see the GitHub Issue #531 Discussion.

Workarounds

  • Implement input validation to restrict XML document size and attribute count before parsing with vulnerable libexpat versions
  • Consider using alternative XML parsers where possible until patching is complete
  • Isolate XML parsing operations in sandboxed environments to limit the impact of potential exploitation
  • Apply network-level controls to filter or inspect XML traffic destined for vulnerable applications
bash
# Update libexpat on Debian-based systems
sudo apt update && sudo apt install --only-upgrade libexpat1

# Verify installed version
dpkg -l | grep libexpat
# Ensure version is 2.4.3 or later

# For systems using source builds, upgrade to patched version
cd /path/to/libexpat
git pull origin master
./configure && make && sudo make install

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

  • Vulnerability Details
  • TypeBuffer Overflow

  • Vendor/TechLibexpat

  • SeverityHIGH

  • CVSS Score8.8

  • EPSS Probability0.35%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-682
  • Technical References
  • OpenWall OSS Security Notice

  • Mozilla Bugzilla Report #1217609

  • Gentoo GLSA 2022-09-24

  • NetApp Security Advisory NTAP-20220121-0004

  • Debian Security Advisory DSA-5073

  • Tenable Security Notification TNS-2022-05
  • Vendor Resources
  • Siemens Product Security Advisory

  • GitHub Issue #531 Discussion

  • GitHub Pull Request #534
  • Related CVEs
  • CVE-2026-25210: libexpat Buffer Overflow Vulnerability

  • CVE-2024-45492: Libexpat Buffer Overflow Vulnerability

  • CVE-2024-45491: Libexpat Buffer Overflow Vulnerability

  • CVE-2022-25314: Libexpat Buffer Overflow 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