PyCrypto before 2.6 does not produce appropriate prime numbers when using an ElGamal…
Priority LOW 25CWE-310Published · Updated
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- — Not recorded in CVSS 2.0
- Attack complexity
- Medium
- Impact type
- —
- Confidentiality · integrity · availability
- None · Partial · None
- Fix status
- Partial Red Hat: 1 without a fix
Attack profile from CVSS 2.0 · NVD. Fix status from CNA, GitHub and Red Hat.
Summary
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.
Why it matters now
EPSS 0.02357 83rd percentileScored 2026-11-07
Public exploit Yes 1 exploit referenceTagged by NVD
Fix Partial PyCrypto (PyPI): 2.6Red Hat: 1 without a fix
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | — | all versions | — | No fix listed | CNA |
| — | PyCrypto (PyPI) | before 2.6 | 2.6 | Patch available | GHSA-v367-p58w-98h5 |
- — Vendor— Affected all versions Fixed in — No fix listed CNA
- PyCrypto (PyPI) Vendor— Affected before 2.6 Fixed in 2.6 Patch available GHSA-v367-p58w-98h5
CPE configurations NVD · 21
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:dlitz:pycrypto:*:*:*:*:*:*:*:* | up to 2.5 | Vulnerable | Dlitz |
| cpe:2.3:a:dlitz:pycrypto:1.0.0:*:*:*:*:*:*:* | 1.0.0 | Vulnerable | Dlitz |
| cpe:2.3:a:dlitz:pycrypto:1.0.1:*:*:*:*:*:*:* | 1.0.1 | Vulnerable | Dlitz |
| cpe:2.3:a:dlitz:pycrypto:1.0.2:*:*:*:*:*:*:* | 1.0.2 | Vulnerable | Dlitz |
| cpe:2.3:a:dlitz:pycrypto:1.1:alpha2:*:*:*:*:*:* | 1.1 alpha2 | Vulnerable | Dlitz |
| cpe:2.3:a:dlitz:pycrypto:1.9:alpha1:*:*:*:*:*:* | 1.9 alpha1 | Vulnerable | Dlitz |
| cpe:2.3:a:dlitz:pycrypto:1.9:alpha2:*:*:*:*:*:* | 1.9 alpha2 | Vulnerable | Dlitz |
| cpe:2.3:a:dlitz:pycrypto:1.9:alpha3:*:*:*:*:*:* | 1.9 alpha3 | Vulnerable | Dlitz |
| cpe:2.3:a:dlitz:pycrypto:1.9:alpha4:*:*:*:*:*:* | 1.9 alpha4 | Vulnerable | Dlitz |
| cpe:2.3:a:dlitz:pycrypto:1.9:alpha5:*:*:*:*:*:* | 1.9 alpha5 | Vulnerable | Dlitz |
- cpe:2.3:a:dlitz:pycrypto:*:*:*:*:*:*:*:* Versions up to 2.5 Vulnerable ·Dlitz
- cpe:2.3:a:dlitz:pycrypto:1.0.0:*:*:*:*:*:*:* Versions 1.0.0 Vulnerable ·Dlitz
- cpe:2.3:a:dlitz:pycrypto:1.0.1:*:*:*:*:*:*:* Versions 1.0.1 Vulnerable ·Dlitz
- cpe:2.3:a:dlitz:pycrypto:1.0.2:*:*:*:*:*:*:* Versions 1.0.2 Vulnerable ·Dlitz
- cpe:2.3:a:dlitz:pycrypto:1.1:alpha2:*:*:*:*:*:* Versions 1.1 alpha2 Vulnerable ·Dlitz
- cpe:2.3:a:dlitz:pycrypto:1.9:alpha1:*:*:*:*:*:* Versions 1.9 alpha1 Vulnerable ·Dlitz
- cpe:2.3:a:dlitz:pycrypto:1.9:alpha2:*:*:*:*:*:* Versions 1.9 alpha2 Vulnerable ·Dlitz
- cpe:2.3:a:dlitz:pycrypto:1.9:alpha3:*:*:*:*:*:* Versions 1.9 alpha3 Vulnerable ·Dlitz
- cpe:2.3:a:dlitz:pycrypto:1.9:alpha4:*:*:*:*:*:* Versions 1.9 alpha4 Vulnerable ·Dlitz
- cpe:2.3:a:dlitz:pycrypto:1.9:alpha5:*:*:*:*:*:* Versions 1.9 alpha5 Vulnerable ·Dlitz
Show 11 more CPE
| CPE | Versions | Role | Vendor |
|---|---|---|---|
| cpe:2.3:a:dlitz:pycrypto:1.9:alpha6:*:*:*:*:*:* | 1.9 alpha6 | Vulnerable | Dlitz |
| cpe:2.3:a:dlitz:pycrypto:2.0:*:*:*:*:*:*:* | 2.0 | Vulnerable | Dlitz |
| cpe:2.3:a:dlitz:pycrypto:2.0.1:*:*:*:*:*:*:* | 2.0.1 | Vulnerable | Dlitz |
| cpe:2.3:a:dlitz:pycrypto:2.1.0:*:*:*:*:*:*:* | 2.1.0 | Vulnerable | Dlitz |
| cpe:2.3:a:dlitz:pycrypto:2.1.0:alpha1:*:*:*:*:*:* | 2.1.0 alpha1 | Vulnerable | Dlitz |
| cpe:2.3:a:dlitz:pycrypto:2.1.0:alpha2:*:*:*:*:*:* | 2.1.0 alpha2 | Vulnerable | Dlitz |
| cpe:2.3:a:dlitz:pycrypto:2.1.0:beta1:*:*:*:*:*:* | 2.1.0 beta1 | Vulnerable | Dlitz |
| cpe:2.3:a:dlitz:pycrypto:2.2:*:*:*:*:*:*:* | 2.2 | Vulnerable | Dlitz |
| cpe:2.3:a:dlitz:pycrypto:2.3:*:*:*:*:*:*:* | 2.3 | Vulnerable | Dlitz |
| cpe:2.3:a:dlitz:pycrypto:2.4:*:*:*:*:*:*:* | 2.4 | Vulnerable | Dlitz |
| cpe:2.3:a:dlitz:pycrypto:2.4.1:*:*:*:*:*:*:* | 2.4.1 | Vulnerable | Dlitz |
- cpe:2.3:a:dlitz:pycrypto:1.9:alpha6:*:*:*:*:*:* Versions 1.9 alpha6 Vulnerable ·Dlitz
- cpe:2.3:a:dlitz:pycrypto:2.0:*:*:*:*:*:*:* Versions 2.0 Vulnerable ·Dlitz
- cpe:2.3:a:dlitz:pycrypto:2.0.1:*:*:*:*:*:*:* Versions 2.0.1 Vulnerable ·Dlitz
- cpe:2.3:a:dlitz:pycrypto:2.1.0:*:*:*:*:*:*:* Versions 2.1.0 Vulnerable ·Dlitz
- cpe:2.3:a:dlitz:pycrypto:2.1.0:alpha1:*:*:*:*:*:* Versions 2.1.0 alpha1 Vulnerable ·Dlitz
- cpe:2.3:a:dlitz:pycrypto:2.1.0:alpha2:*:*:*:*:*:* Versions 2.1.0 alpha2 Vulnerable ·Dlitz
- cpe:2.3:a:dlitz:pycrypto:2.1.0:beta1:*:*:*:*:*:* Versions 2.1.0 beta1 Vulnerable ·Dlitz
- cpe:2.3:a:dlitz:pycrypto:2.2:*:*:*:*:*:*:* Versions 2.2 Vulnerable ·Dlitz
- cpe:2.3:a:dlitz:pycrypto:2.3:*:*:*:*:*:*:* Versions 2.3 Vulnerable ·Dlitz
- cpe:2.3:a:dlitz:pycrypto:2.4:*:*:*:*:*:*:* Versions 2.4 Vulnerable ·Dlitz
- cpe:2.3:a:dlitz:pycrypto:2.4.1:*:*:*:*:*:*:* Versions 2.4.1 Vulnerable ·Dlitz
Remediation
- Fix · GHSA-v367-p58w-98h5 PyCrypto (PyPI) Fixed in 2.6 Advisory →
Vendor assessments
Red Hat
Red Hat rating: Moderate. Red Hat's page for this CVE →
| Product | Status | Plan or fix |
|---|---|---|
| Red Hat Enterprise Linux 6 | Affected | No fix planned: Will not fix |
Timeline
- 2026-10-02 Threatist record created from CVE-2012-2417
- 2026-10-03 Alias added: GHSA-v367-p58w-98h5
References
Advisory 7
Other 8
- 82279
- https://bugs.launchpad.net/pycrypto/+bug/985164
- [oss-security] 20120524 CVE-2012-2417 - PyCrypto <= 2.5 insecure ElGamal key generation
- https://github.com/dlitz/pycrypto/blob/373ea760f21701b162e8c4912a66928ee30d401a/ChangeLog
- https://github.com/Legrandin/pycrypto
- https://github.com/pypa/advisory-database/tree/main/vulns/pycrypto/PYSEC-2012-16.yaml
- https://web.archive.org/web/20140724111917/http://secunia.com/advisories/49263
- https://web.archive.org/web/20200228184120/http://www.securityfocus.com/bid/53687
More Dlitz Pycrypto vulnerabilities
- TI-2013-06111 Heap-based buffer overflow in the ALGnew function in block_templace.c in Python… CVSS 3.0CRITICAL 9.8
- TI-2018-04861 lib/Crypto/PublicKey/ElGamal.py in PyCrypto through 2.6.1 generates weak ElGamal key… CVSS 3.0HIGH 7.5
- TI-2013-01262 The Crypto.Random.atfork function in PyCrypto before 2.6.1 does not properly reseed the… CVSS 2.0MEDIUM 4.3
Sources
- CVE-2012-2417 · CVE Program
- CVE-2012-2417 · NVD
- FIRST EPSS
- GHSA-v367-p58w-98h5 · GitHub Advisory Database · CC BY 4.0
- CVE-2012-2417 · Red Hat security data · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences