# CVE-2012-2417: PyCrypto makes Use of Insufficiently Random Values

Source: https://junglewise.ai/threats/cve-2012-2417-pycrypto-makes-use-of-insufficiently-random-values  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2012-06-17  
License: CC BY 4.0 with a link back

CVE-2012-2417 · Severity: low · CVSS 3.1 · Published 2012-06-17

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.

Technologies: [pycrypto (PyPI)](https://junglewise.ai/threats/technologies/pypi-pycrypto). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2012-2417 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2012-2417 being exploited in the wild.

**How severe is CVE-2012-2417?** Low severity, with a CVSS score of 3.1, published 17 June 2012.

**Which products and versions are affected?** pycrypto (PyPI) ECOSYSTEM:introduced=0,fixed=2.6, GIT:introduced=0,fixed=9f912f13df99ad3421eff360d6a62d7dbec755c2|ECOSYSTEM:introduced=0,fixed=2.6.

**Is there a fix for CVE-2012-2417?** Yes. pycrypto (PyPI): upgrade to 2.6 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2012-2417?** Check whether you run pycrypto (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- pycrypto (PyPI): upgrade to 2.6 or later

  ```sh
  pip install "pycrypto>=2.6"
  ```


## Affected products

- pycrypto (PyPI) ECOSYSTEM:introduced=0,fixed=2.6, GIT:introduced=0,fixed=9f912f13df99ad3421eff360d6a62d7dbec755c2|ECOSYSTEM:introduced=0,fixed=2.6

## Identifiers

- CVE-2012-2417
- GHSA-v367-p58w-98h5
- PYSEC-2012-16

## Related threats

- [Pycrypto generates weak key parameters](https://junglewise.ai/threats/cve-2018-6594-pycrypto-generates-weak-key-parameters)
- [Buffer Overflow in pycrypto](https://junglewise.ai/threats/cve-2013-7459-buffer-overflow-in-pycrypto)
- [PyCrypto does not properly reseed PRNG before allowing access](https://junglewise.ai/threats/cve-2013-1445-pycrypto-does-not-properly-reseed-prng-before-allowing-access)
