Description
lib/Crypto/PublicKey/ElGamal.py in PyCrypto through 2.6.1 generates weak ElGamal key parameters, which allows attackers to obtain sensitive information by reading ciphertext data (i.e., it does not have semantic security in face of a ciphertext-only attack). The Decisional Diffie-Hellman (DDH) assumption does not hold for PyCrypto's ElGamal implementation.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | pycryptodome | 3.4.11-1 | — |
| Debian 13 | pycryptodome | 3.4.11-1 | — |
| Debian 12 | pycryptodome | 3.4.11-1 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 18.04 LTS | pycryptodome | 3.4.7-1ubuntu1 | — |
| Ubuntu 18.04 LTS | python-crypto | 2.6.1-8ubuntu2 | — |
| Ubuntu 16.04 LTS | python-crypto | 2.6.1-6ubuntu0.16.04.3 | USN-3616-1 |
| Ubuntu 14.04 LTS | python-crypto | 2.6.1-4ubuntu0.3 | USN-3616-1 |
Amazon Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Amazon Linux 2023 | python3-crypto | 2.6.1-34.amzn2023.0.2 | ALAS2023-2025-1051 |
Affected packages
| Ecosystem | Package | Affected | Fixed | Record |
|---|---|---|---|---|
| PyPI | pycrypto | <= 2.6.1 | — | GHSA-6528-wvf6-f6qg |
| PyPI | pycrypto | all versions | — | PYSEC-2018-97 |
Advisories 3
- USN-3616-1 python-crypto vulnerability Ubuntu Security Notices (USN) · Feb 10, 2026
- ALAS2023-2025-1051 Moderate: python-crypto security update (Amazon Linux 2023) Amazon Linux Security Center (ALAS) · Jul 10, 2025
- WID-SEC-2025-0498 python-crypto: Schwachstelle ermöglicht Offenlegung von Informationen BSI CERT-Bund (WID) · Mar 6, 2025
References
- https://github.com/TElgamal/attack-on-pycrypto-elgamal
- USN-3616-1 vendor-advisory
- https://github.com/dlitz/pycrypto/issues/253
- [debian-lts-announce] 20180215 [SECURITY] [DLA 1283-1] python-crypto security update mailing-list
- USN-3616-2 vendor-advisory
- GLSA-202007-62 vendor-advisory