What’s Vulnerable › Vulnerabilities
CVE-2021-40528
- Severity: medium (CVSS 5.9 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 1.4% probability of exploitation in the next 30 days
- Public exploit or detection template: yes
- Published: 2021-09-06 · updated 2026-06-17
- Weakness: CWE-327
Description
The ElGamal implementation in Libgcrypt before 1.9.4 allows plaintext recovery because, during interaction between two cryptographic libraries, a certain dangerous combination of the prime defined by the receiver's public key, the generator defined by the receiver's public key, and the sender's ephemeral exponents can lead to a cross-configuration attack against OpenPGP.
Affected products
- gnupg Libgcrypt: before 1.9.4 — fixed in 1.9.4
How to fix
Upgrade to a fixed version: gnupg Libgcrypt 1.9.4. Check the vendor advisory for mitigations.
References
- https://eprint.iacr.org/2021/923
- https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git%3Ba=commit%3Bh=3462280f2e23e16adf3ed5176e0f2413d8861320
- https://ibm.github.io/system-security-research-updates/2021/07/20/insecurity-elgamal-pt1
- https://ibm.github.io/system-security-research-updates/2021/09/06/insecurity-elgamal-pt2
- https://security.gentoo.org/glsa/202210-13
- https://eprint.iacr.org/2021/923
- https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git%3Ba=commit%3Bh=3462280f2e23e16adf3ed5176e0f2413d8861320
- https://ibm.github.io/system-security-research-updates/2021/07/20/insecurity-elgamal-pt1
- https://ibm.github.io/system-security-research-updates/2021/09/06/insecurity-elgamal-pt2
- https://security.gentoo.org/glsa/202210-13
Get alerted when CVE-2021-40528 or the next vulnerability affects your stack