Buffer Overflow Vulnerability in NumPy

numpy Updated 02 Oct 2025

Summary

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

CVE-2021-41496: Buffer overflow in the array_from_pyobj function of fortranobject.c in NumPy < 1.19, which allows attackers to conduct a Denial of Service attacks by carefully constructing an array with negative values. Affects numpy versions < 92ebe1e9a6aeb47a881a1226b08218175776f9ea. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

NumPy is a popular library in the Python ecosystem that provides support for large, multi-dimensional arrays and matrices, along with a collection of mathematical functions to operate on these arrays. It is widely used in scientific computing and data analysis. However, versions of NumPy prior to 1.19 are vulnerable to a buffer overflow issue.

Vulnerability Detail

The vulnerability, identified as CVE-2021-41496, exists in the array_from_pyobj function of fortranobject.c in NumPy. Attackers can exploit this vulnerability by carefully constructing an array with negative values. This can lead to a buffer overflow, potentially resulting in a Denial of Service (DoS) attack. It is important to note that the vendor does not consider this a vulnerability, as the negative dimensions can only be created by an already privileged user or internally.

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

There is no specific workaround mentioned for this vulnerability.

Conclusion

In conclusion, NumPy versions prior to 1.19 are vulnerable to a buffer overflow issue that can be exploited for a Denial of Service attack. It is recommended to update NumPy to the latest version to mitigate this vulnerability. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for numpy →

Share this vulnerability

FAQ

NumPy is a Python library that provides support for large, multi-dimensional arrays and matrices, along with a collection of mathematical functions to operate on these arrays. It is widely used in scientific computing and data analysis.

The vulnerability can be exploited to conduct a Denial of Service (DoS) attack by causing a buffer overflow. However, the negative dimensions required for exploitation can only be created by an already privileged user or internally.

To fix this vulnerability, update NumPy to version 1.19 or later. This update includes a patch that addresses the buffer overflow issue.

No specific workaround has been mentioned for this vulnerability.

The vendor does not consider this vulnerability critical, as the negative dimensions required for exploitation can only be created by an already privileged user or internally.

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