CVE-2012-2417: PyCrypto PyCrypto Makes Use Of Insufficiently Vulnerability
MODERATECVE-2012-2417 is a MODERATE (CVSS 5.3) pycrypto makes use of insufficiently vulnerability (General Security Weakness) affecting PyCrypto libraries in the PyPI ecosystem. The issue involves pycrypto makes use of insufficiently random values. Remediation is available by upgrading affected packages to version 2.6.
CVE-2012-2417 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:L/PR:N/UI:N/S:U/C:L/I:N/A:N).
How to Fix CVE-2012-2417
To remediate this vulnerability, upgrade all affected PyCrypto 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 PyCrypto>=2.6
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show PyCrypto
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2012-2417, inspect your installed packages using pip:
pip show PyCrypto
Analyze the terminal output to locate any version of PyCrypto in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.6), your application is affected.
Note: The pip show PyCrypto command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under General Security Weakness. In PyCrypto, 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-2012-2417 Affected PyCrypto Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
PyCrypto
|
PyPI |
< 2.6
|
2.6
|
References
Frequently Asked Questions
What is CVE-2012-2417?
Which PyCrypto versions are affected?
What version fixes CVE-2012-2417?
Is PyCrypto affected?
What is the CVSS score of CVE-2012-2417?
What CWE is associated with CVE-2012-2417?
How can I check PyPI dependencies for CVE-2012-2417?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-v367-p58w-98h5",
"modified" : "2024-10-21T20:04:17Z",
"published" : "2022-05-17T01:46:08Z",
"aliases" : [ "CVE-2012-2417" ],
"summary" : "PyCrypto makes Use of Insufficiently Random Values",
"details" : "PyCrypto before 2.6 does not produce appropriate prime numbers when using an ElGamal scheme to generate a key, which reduces the signature space or public key space and makes it easier for attackers to conduct brute force attacks to obtain the private key.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "PyCrypto"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.6"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2012-2417"
}, {
"type" : "WEB",
"url" : "https://github.com/Legrandin/pycrypto/commit/9f912f13df99ad3421eff360d6a62d7dbec755c2"
}, {
"type" : "WEB",
"url" : "https://bugs.launchpad.net/pycrypto/+bug/985164"
}, {
"type" : "WEB",
"url" : "https://exchange.xforce.ibmcloud.com/vulnerabilities/75871"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/Legrandin/pycrypto"
}, {
"type" : "WEB",
"url" : "https://github.com/dlitz/pycrypto/blob/373ea760f21701b162e8c4912a66928ee30d401a/ChangeLog"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/pycrypto/PYSEC-2012-16.yaml"
}, {
"type" : "WEB",
"url" : "https://hermes.opensuse.org/messages/15083589"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20140724111917/http://secunia.com/advisories/49263"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20200228184120/http://www.securityfocus.com/bid/53687"
}, {
"type" : "WEB",
"url" : "http://lists.fedoraproject.org/pipermail/package-announce/2012-June/081713.html"
}, {
"type" : "WEB",
"url" : "http://lists.fedoraproject.org/pipermail/package-announce/2012-June/081759.html"
}, {
"type" : "WEB",
"url" : "http://lists.fedoraproject.org/pipermail/package-announce/2012-June/081789.html"
}, {
"type" : "WEB",
"url" : "http://www.debian.org/security/2012/dsa-2502"
}, {
"type" : "WEB",
"url" : "http://www.mandriva.com/security/advisories?name=MDVSA-2012:117"
}, {
"type" : "WEB",
"url" : "http://www.openwall.com/lists/oss-security/2012/05/25/1"
} ],
"database_specific" : {
"cwe_ids" : [ ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2024-04-30T14:35:18Z",
"nvd_published_at" : "2012-06-17T03:41:00Z"
}
}