CVE-2017-12852: Numpy Numpy Missing Input Validation Vulnerability
HIGHCVE-2017-12852 is a HIGH (CVSS 7.5) numpy missing input validation vulnerability (CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')) affecting Numpy libraries in the PyPI ecosystem. The issue involves numpy missing input validation. Remediation is available by upgrading affected packages to version 1.13.3.
CVE-2017-12852 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).
How to Fix CVE-2017-12852
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.13.3
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-2017-12852, 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.13.3), 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-835: Loop with Unreachable Exit Condition ('Infinite Loop'), where the product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop. 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-2017-12852 Affected Numpy Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
numpy
|
PyPI |
< 1.13.3
|
1.13.3
|
References
Frequently Asked Questions
What is CVE-2017-12852?
Which Numpy versions are affected?
What version fixes CVE-2017-12852?
Is numpy affected?
What is the CVSS score of CVE-2017-12852?
What CWE is associated with CVE-2017-12852?
How can I check PyPI dependencies for CVE-2017-12852?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-frgw-fgh6-9g52",
"modified" : "2022-06-17T21:05:33Z",
"published" : "2022-05-13T01:42:46Z",
"aliases" : [ "CVE-2017-12852" ],
"summary" : "Numpy missing input validation",
"details" : "The numpy.pad function in Numpy 1.13.1 and older versions is missing input validation. An empty list or ndarray will stick into an infinite loop, which can allow attackers to cause a DoS attack.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "numpy"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.13.3"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-12852"
}, {
"type" : "WEB",
"url" : "https://github.com/numpy/numpy/issues/9560#issuecomment-322395292"
}, {
"type" : "WEB",
"url" : "https://github.com/BT123/testcasesForMyRequest/tree/master/CVE-2017-12852"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-frgw-fgh6-9g52"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/numpy/numpy"
}, {
"type" : "WEB",
"url" : "https://github.com/numpy/numpy/releases/tag/v1.13.3"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/numpy/PYSEC-2017-1.yaml"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-835" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-06-17T21:05:33Z",
"nvd_published_at" : "2017-08-15T16:29:00Z"
}
}