CVE-2021-41496 — numpy
MEDIUMCVE-2021-41496 is a medium-severity (CVSS 5.5) CWE-120 vulnerability in numpy. 1 public exploit reference exists, so weaponization risk is real. A fix is available for numpy — see the affected versions and patch details below.
Buffer Copy without Checking Size of Input in NumPy
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
CVE-2021-41496 by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 385,738 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
numpyReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects PyPI packages — download data is not available via public APIs for these ecosystems.
Description
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. NOTE: The vendor does not agree this is a vulnerability; the negative dimensions can only be created by an already privileged user (or internally)
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐍PyPI | numpy | all versions | 1.19pip install --upgrade 'numpy==1.19' |
Affected Products
numpynumpyResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for numpy, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update numpy to 1.19 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2021-41496 is resolved across your whole dependency graph.
Workarounds
Constrain what reaches the vulnerable code: limit the size and shape of untrusted input, isolate the affected component in a sandboxed or least-privileged process, and enable the platform's memory-safety mitigations (ASLR, stack protector, hardened allocator) so an out-of-bounds access is more likely to fail closed than to be exploitable.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
| Product | Fixed in | Advisory |
|---|---|---|
| Red Hat OpenStack Platform 16.1 | numpy-1:1.17.0-8.el8ost | RHSA-2022:0987 |
| Red Hat OpenStack Platform 16.2 | numpy-1:1.17.0-8.el8ost | RHSA-2022:1000 |
Frequently Asked Questions
Is CVE-2021-41496 in your dependencies?
Find it across PyPI, including transitive dependencies.