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

CVE-2021-41495: NumPy Null Pointer Dereference DoS Flaw

CVE-2021-41495 is a null pointer dereference vulnerability in NumPy's numpy.sort function that can lead to denial of service attacks. This article covers the technical details, affected versions, impact assessment, and mitigation.

Published: February 25, 2026

CVE-2021-41495 Overview

A Null Pointer Dereference vulnerability exists in numpy.sort in NumPy versions prior to 1.19. The vulnerability is located in the PyArray_DescrNew function due to missing return-value validation. This flaw allows attackers to conduct Denial of Service (DoS) attacks by repetitively creating sort arrays.

It's important to note that while the validation is indeed missing, an error can only occur due to memory exhaustion. If an attacker can exhaust memory, they are already in a privileged position. Furthermore, it should be practically impossible to construct an attack that can precisely target memory exhaustion to occur at this specific location in the code.

Critical Impact

This vulnerability enables potential DoS attacks against applications using NumPy's sort functionality, though practical exploitation requires the ability to exhaust system memory.

Affected Products

  • NumPy versions prior to 1.19
  • Applications and services depending on vulnerable NumPy versions
  • Oracle products (as referenced in July 2022 Security Alert)

Discovery Timeline

  • 2021-12-17 - CVE CVE-2021-41495 published to NVD
  • 2024-11-21 - Last updated in NVD database

Technical Details for CVE-2021-41495

Vulnerability Analysis

The vulnerability stems from improper error handling in the NumPy library's sorting functionality. Specifically, the PyArray_DescrNew function fails to validate its return value properly. When this function is called during array sorting operations via numpy.sort, a null pointer can be dereferenced under certain memory pressure conditions.

This is classified as CWE-476 (NULL Pointer Dereference), a common weakness where the application dereferences a pointer that it expects to be valid but is actually null. While the attack vector is network-accessible, exploitation requires high complexity as the attacker must be able to exhaust system memory to trigger the condition.

The practical exploitability is considered limited because:

  1. The vulnerability requires memory exhaustion to trigger
  2. An attacker capable of exhausting memory already has significant system access
  3. Precisely targeting this specific code path during memory exhaustion is extremely difficult

Root Cause

The root cause of CVE-2021-41495 is the absence of return-value validation in the PyArray_DescrNew function. When memory allocation fails during array descriptor creation, the function may return a null pointer. The calling code in numpy.sort does not check for this null return value before attempting to use the pointer, leading to a null pointer dereference.

This is a classic case of missing error handling for memory allocation failures. Proper defensive programming would require checking the return value of PyArray_DescrNew and handling the error condition gracefully rather than proceeding with an invalid pointer.

Attack Vector

The attack vector is network-based, requiring an authenticated user with low privileges. An attacker would need to:

  1. Have the ability to interact with an application that uses NumPy's sorting functionality
  2. Submit requests that cause repeated array sort operations
  3. Exhaust system memory to trigger the null pointer condition
  4. The application would crash or become unresponsive, resulting in a Denial of Service

However, as noted in the vulnerability description, the practical difficulty of targeting this specific memory exhaustion point makes real-world exploitation highly unlikely.

The vulnerability mechanism involves the numpy.sort function calling internal array descriptor creation routines. When PyArray_DescrNew is invoked and memory is exhausted, it returns null. The subsequent code attempts to use this null pointer, causing the application to crash. For technical details, see the GitHub Issue Discussion.

Detection Methods for CVE-2021-41495

Indicators of Compromise

  • Unexpected application crashes or segmentation faults in processes using NumPy
  • Repeated memory allocation failures preceding application crashes
  • Unusual patterns of array sorting operations from external sources
  • System-wide memory exhaustion events correlated with NumPy-dependent application failures

Detection Strategies

  • Monitor for segmentation faults or null pointer dereference errors in application logs that correlate with NumPy operations
  • Implement resource usage monitoring to detect abnormal memory consumption patterns
  • Use application performance monitoring (APM) tools to identify unusual array sorting operation volumes
  • Deploy runtime application self-protection (RASP) solutions to detect memory-related anomalies

Monitoring Recommendations

  • Set up alerts for memory exhaustion conditions on systems running NumPy-dependent applications
  • Monitor process crash rates for applications that utilize numpy.sort functionality
  • Implement logging for array operations to identify potential abuse patterns
  • Track system resource utilization metrics to establish baselines and detect anomalies

How to Mitigate CVE-2021-41495

Immediate Actions Required

  • Upgrade NumPy to version 1.19 or later where proper return-value validation is implemented
  • Audit applications for dependencies on vulnerable NumPy versions
  • Implement memory limits and resource quotas for processes using NumPy
  • Consider implementing request rate limiting for operations that trigger array sorting

Patch Information

The vulnerability affects NumPy versions prior to 1.19. Organizations should upgrade to NumPy 1.19 or later to receive the fix that includes proper return-value validation in the PyArray_DescrNew function. For additional context on affected Oracle products, refer to the Oracle Security Alert July 2022.

Workarounds

  • Implement memory limits using operating system controls such as ulimit or cgroups to prevent complete memory exhaustion
  • Deploy application-level memory monitoring to terminate processes before they can trigger the vulnerability
  • Use containerization with memory constraints to isolate NumPy-dependent applications
  • Implement input validation to limit the size and frequency of array operations that could trigger sorting
bash
# Configuration example - Limit memory for NumPy processes
# Using ulimit to set memory limits (in KB)
ulimit -v 4194304  # Limit virtual memory to 4GB

# Using cgroups to limit memory for a process group
cgcreate -g memory:/numpy_apps
echo 4294967296 > /sys/fs/cgroup/memory/numpy_apps/memory.limit_in_bytes

# Run application with memory constraints
cgexec -g memory:numpy_apps python your_numpy_application.py

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

  • Vulnerability Details
  • TypeDOS

  • Vendor/TechNumpy

  • SeverityMEDIUM

  • CVSS Score5.3

  • EPSS Probability0.12%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H
  • Impact Assessment
  • ConfidentialityHigh
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-476
  • Technical References
  • GitHub Issue Discussion

  • Oracle Security Alert July 2022
  • Related CVEs
  • CVE-2021-41496: NumPy Buffer Overflow DoS Vulnerability

  • CVE-2021-34141: NumPy Incomplete String Comparison Flaw
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