A Leader in the 2026 Gartner® Magic Quadrant™ for Endpoint Protection. Six years running.Six years. Gartner® Magic Quadrant™ Leader.Find Out Why
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-2022-40674

CVE-2022-40674: Libexpat Use-After-Free Vulnerability

CVE-2022-40674 is a use-after-free vulnerability in Libexpat's doContent function affecting versions before 2.4.9. This flaw can lead to memory corruption and potential exploitation. This article covers technical details.

Updated: May 14, 2026

CVE-2022-40674 Overview

CVE-2022-40674 is a use-after-free vulnerability in libexpat versions prior to 2.4.9. The flaw resides in the doContent function within xmlparse.c, a core routine responsible for processing XML content during parsing. Because libexpat is a widely deployed streaming XML parser embedded in countless applications, operating systems, and network appliances, the vulnerability has broad downstream impact. Affected ecosystems include Debian GNU/Linux 10 and 11, Fedora 35 through 37, and NetApp products that bundle the library. Successful exploitation can lead to arbitrary code execution, integrity loss, or process crashes when a vulnerable application parses attacker-controlled XML.

Critical Impact

Network-reachable applications parsing untrusted XML through libexpat can be coerced into use-after-free conditions, enabling potential remote code execution and full compromise of the affected process.

Affected Products

  • libexpat versions before 2.4.9
  • Debian GNU/Linux 10 and 11
  • Fedora 35, 36, and 37 (additional NetApp products referenced in NTAP-20221028-0008)

Discovery Timeline

  • 2022-09-14 - CVE-2022-40674 published to the National Vulnerability Database
  • 2025-05-30 - Last updated in NVD database

Technical Details for CVE-2022-40674

Vulnerability Analysis

The vulnerability is classified as a use-after-free [CWE-416] in the doContent function of xmlparse.c. During XML content processing, libexpat maintains internal references to parser state and buffer memory. Under specific parsing conditions, the parser can continue to operate on memory that has already been released, producing a dangling pointer dereference. An attacker who controls the XML stream supplied to a vulnerable application can shape allocations and frees to trigger the unsafe access.

Use-after-free conditions in C-based parsers frequently translate into exploitable memory corruption. Depending on heap layout and the application embedding libexpat, the consequences range from controlled process crashes to attacker-influenced control flow. The attack requires no authentication and no user interaction, which expands the exploit surface for any service that ingests XML from the network.

Root Cause

The root cause is the absence of proper lifetime management for objects referenced inside doContent during content callbacks. When parsing logic frees an internal structure but subsequently dereferences it, the parser operates on memory that may have been reallocated for unrelated data. Upstream fixes were merged through libexpat pull requests #629 and #640, which correct the pointer handling.

Attack Vector

The attack vector is network-based. An attacker submits crafted XML to any service or client that parses input through a vulnerable libexpat build. Typical exposure points include SOAP endpoints, RSS/Atom feed readers, configuration parsers, document processors, and embedded device management interfaces. No verified public proof-of-concept exploit code is available at the time of writing, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog.

// No verified public exploit code is available for CVE-2022-40674.
// Refer to upstream pull requests #629 and #640 for the corrective patches in xmlparse.c.

Detection Methods for CVE-2022-40674

Indicators of Compromise

  • Unexpected crashes, segmentation faults, or abort signals in processes that link against libexpat after receiving XML input
  • Heap corruption traces in core dumps referencing doContent or related symbols in xmlparse.c
  • Anomalous outbound connections originating from processes that normally only parse XML locally

Detection Strategies

  • Inventory all packages and applications that statically or dynamically link libexpat and compare versions against 2.4.9 or later using package managers (dpkg -l, rpm -qa, apk info).
  • Inspect XML ingress for malformed or deeply nested structures designed to manipulate parser allocation behavior.
  • Correlate process crash telemetry with preceding network XML payloads to identify probing activity.

Monitoring Recommendations

  • Enable address sanitizer or hardened malloc in pre-production builds to surface latent use-after-free behavior during testing.
  • Forward crash reports and AppArmor or SELinux denials to a centralized log platform for correlation across hosts.
  • Track upstream advisories from Debian (DSA-5236), Fedora, Gentoo (GLSA 202209-24), and NetApp NTAP-20221028-0008 for additional affected components.

How to Mitigate CVE-2022-40674

Immediate Actions Required

  • Upgrade libexpat to version 2.4.9 or later on every host and within every application bundle that ships its own copy.
  • Apply distribution security updates from Debian, Fedora, and Gentoo to refresh both the shared library and any dependent packages.
  • Rebuild and redeploy in-house software that statically links libexpat against the patched source tree.

Patch Information

The upstream fixes were merged in libexpat 2.4.9 via GitHub Pull Request #629 and GitHub Pull Request #640. Distribution-specific patches are published in Debian DSA-5236, the Debian LTS announcement, the Fedora package-announce list, Gentoo GLSA 202209-24, Gentoo GLSA 202211-06, and NetApp NTAP-20221028-0008.

Workarounds

  • Restrict network exposure of services that parse untrusted XML until patching is complete.
  • Validate and constrain XML input size and structure at an upstream proxy or WAF.
  • Run XML-processing services under least-privilege accounts with seccomp or AppArmor profiles to limit post-exploitation impact.
bash
# Verify installed libexpat version on Debian/Ubuntu
dpkg -l | grep -i libexpat
apt-get update && apt-get install --only-upgrade libexpat1

# Verify installed libexpat version on Fedora
rpm -q expat
dnf upgrade expat

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

  • Vulnerability Details
  • TypeUse After Free

  • Vendor/TechLibexpat

  • SeverityHIGH

  • CVSS Score8.1

  • EPSS Probability0.92%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-416
  • Technical References
  • Debian LTS Security Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Fedora Package Announcement

  • Gentoo GLSA 2022-09-24

  • Gentoo GLSA 2022-11-06

  • NetApp Security Advisory NTAP-20221028-0008

  • Debian Security Advisory DSA-5236
  • Vendor Resources
  • GitHub Pull Request #629

  • GitHub Pull Request #640
  • Related CVEs
  • CVE-2026-50219: libexpat Use-After-Free Vulnerability

  • CVE-2022-43680: Libexpat Use-After-Free Vulnerability

  • CVE-2026-7210: Libexpat XXE Vulnerability

  • CVE-2026-45186: Libexpat DOS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today 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