CVE-2021-33430: Numpy NumPy Buffer Overflow (Disputed) Vulnerability
MODERATECVE-2021-33430 is a MODERATE (CVSS 5.3) numpy buffer overflow (disputed) vulnerability (CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')) affecting Numpy libraries in the PyPI ecosystem. The issue involves numpy buffer overflow (disputed). Remediation is available by upgrading affected packages to version 1.21.
CVE-2021-33430 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2021-33430
To remediate this vulnerability, upgrade all affected Numpy dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install numpy>=1.21
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show numpy
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2021-33430, inspect your installed packages using pip:
pip show numpy
Analyze the terminal output to locate any version of Numpy in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.21), your application is affected.
Note: The pip show numpy command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow'), where the product copies an input buffer to an output buffer without verifying that the size of the input buffer is less than the size of the output buffer. In Numpy, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2021-33430 Affected Numpy Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
numpy
|
PyPI |
≥ 1.9.0
< 1.21
|
1.21
|
References
Frequently Asked Questions
What is CVE-2021-33430?
Which Numpy versions are affected?
What version fixes CVE-2021-33430?
Is numpy affected?
What is the CVSS score of CVE-2021-33430?
What CWE is associated with CVE-2021-33430?
How can I check PyPI dependencies for CVE-2021-33430?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-6p56-wp2h-9hxr",
"modified" : "2024-09-26T14:21:10Z",
"published" : "2022-01-07T00:09:39Z",
"aliases" : [ "CVE-2021-33430" ],
"summary" : "NumPy Buffer Overflow (Disputed)",
"details" : "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 Denial of Service.\n\nNOTE: The vendor does not agree this is a vulnerability; In (very limited) circumstances a user may be able provoke the buffer overflow, the user is most likely already privileged to at least provoke denial of service by exhausting memory. Triggering this further requires the use of uncommon API (complicated structured dtypes), which is very unlikely to be available to an unprivileged user.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:H/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "numpy"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.9.0"
}, {
"fixed" : "1.21"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-33430"
}, {
"type" : "WEB",
"url" : "https://github.com/numpy/numpy/issues/18939"
}, {
"type" : "WEB",
"url" : "https://github.com/numpy/numpy/commit/ae317fd9ff3e79c0eac357d723bfc29cbd625f2e"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/numpy/numpy"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/numpy/PYSEC-2021-854.yaml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-120" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-01-04T20:52:47Z",
"nvd_published_at" : "2021-12-17T19:15:00Z"
}
}