Buffer Overflow Vulnerability in NumPy: Denial of Service Risk

numpy Updated 02 Oct 2025

Summary

17/12/2021
N/A
No i
Medium
5.3

CVE-2021-33430: A Buffer Overflow vulnerability exists in NumPy 1.9.x in the PyArray_NewFromDescr_int function of ctors.c when specifying arrays of large dimensions (over 32) from Python code, which could let a malicious user cause a De... Affects numpy versions >= 07601a64cdfeb1c0247bde1294ad6380413cab66, <= edb902cdc6573553afcf11047ecdfb447e444322. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

NumPy is a widely-used open-source library in Python for numerical computing, providing support for large, multi-dimensional arrays and matrices, along with a collection of mathematical functions to operate on these arrays. It is a fundamental package for scientific computing in Python, enabling efficient data manipulation and analysis. However, certain versions of NumPy (specifically 1.9.x) are susceptible to a buffer overflow vulnerability that can lead to denial of service under specific conditions.

Vulnerability Detail

A Buffer Overflow vulnerability exists in NumPy 1.9.x within the PyArray_NewFromDescr_int function of ctors.c. This issue arises when users specify arrays with large dimensions (over 32) from Python code. Although the vendor does not classify this as a significant vulnerability, it could allow a malicious user to cause a denial of service. The conditions to trigger this vulnerability are limited, requiring the use of uncommon API features (such as complicated structured dtypes), which are unlikely to be accessible to unprivileged users. The CVSS score for this vulnerability is 5.3, indicating a moderate risk level.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

If upgrading is not immediately possible, consider limiting the use of large dimension arrays or avoiding the use of complicated structured dtypes in your code to mitigate the risk of triggering the buffer overflow.

Conclusion

In summary, the buffer overflow vulnerability in NumPy 1.9.x poses a risk of denial of service under specific conditions. Users are advised to upgrade to the latest version to mitigate this risk. Additionally, temporary workarounds can be employed until an upgrade is possible. Utilizing tools like Vulert can help in monitoring and managing vulnerabilities effectively.

See every vulnerability recorded for numpy →

Share this vulnerability

FAQ

A buffer overflow vulnerability occurs when a program writes more data to a block of memory, or buffer, than it was allocated for. This can lead to unexpected behavior, including crashes or security breaches.

If exploited, this vulnerability can lead to a denial of service, causing your application to crash or become unresponsive, especially when handling large arrays.

Versions of NumPy prior to 1:1.21.4-2 are affected by this vulnerability. Check your installed version and upgrade if necessary.

If an immediate upgrade is not feasible, avoid using large dimension arrays and complicated structured dtypes in your code as a temporary workaround.

Vulert provides real-time monitoring and alerts for open-source vulnerabilities using just a manifest file like package-lock.json. You can check if your application is affected by this vulnerability using the Vulert playground without any signup.

Related vulnerabilities

Recent vulnerabilities recorded for numpy.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback