CVE-2021-40528
The ElGamal implementation in Libgcrypt before 1.9.4 allows plaintext recovery because, during...
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.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- High
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- None
- Availability
- None
Exploit likelihood
What each source reports
NVD Score used
5.9
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.
- Record
CVE-2021-40528- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - CVSS 2.0
- 2.6 Low
AV:N/AC:H/Au:N/C:P/I:N/A:N - Weakness
- CWE-327
- Updated
- 2026-11-02
CVE List
5.9
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.
- Record
CVE-2021-40528- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-327
- Updated
- 2026-11-02
EUVDEUVD-2021-27703
5.9
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.
- Record
EUVD-2021-27703- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
GitHub AdvisoriesGHSA-8m2v-68m9-q2c7
5.9
The ElGamal implementation in Libgcrypt before 1.9.4 allows plaintext recovery because, during...
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.
- Record
GHSA-8m2v-68m9-q2c7- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - Weakness
- CWE-327
- Updated
- 2026-11-02
OSVALPINE-CVE-2021-40528
5.9
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.
- Record
ALPINE-CVE-2021-40528- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
OSVBELL-CVE-2021-40528
5.9
CVE-2021-40528 does not affect BellSoft software
- Record
BELL-CVE-2021-40528- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
Show 14 moreShow less
OSV
5.9
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.
- Record
CVE-2021-40528- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
OSVDEBIAN-CVE-2021-40528
5.9
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.
- Record
DEBIAN-CVE-2021-40528- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
OSVJLSEC-2026-124
5.9
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.
- Record
JLSEC-2026-124- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - CVSS 2.0
- 2.6 Low
AV:N/AC:H/Au:N/C:P/I:N/A:N - Updated
- 2026-11-02
OSVOESA-2021-1362
5.9
libgcrypt security update
Libgcrypt is a general purpose cryptographic library originally based on code from GnuPG.
Security Fix(es):
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.(CVE-2021-40528)
- Record
OESA-2021-1362- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
OSVRHSA-2022:5311
5.9
Red Hat Security Advisory: libgcrypt security update
- Record
RHSA-2022:5311- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
OSVRLSA-2022:5311
5.9
Moderate: libgcrypt security update
The libgcrypt library provides general-purpose implementations of various cryptographic algorithms.
Security Fix(es):
- libgcrypt: ElGamal implementation allows plaintext recovery (CVE-2021-40528)
For more details about the security issue(s), including the impact, a CVSS score, acknowledgments, and other related information, refer to the CVE page(s) listed in the References section.
- Record
RLSA-2022:5311- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
OSVUBUNTU-CVE-2021-40528
5.9
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.
- Record
UBUNTU-CVE-2021-40528- CVSS 3.1
- 5.9 Medium
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
OSVALSA-2022:5311 No score
Moderate: libgcrypt security update
The libgcrypt library provides general-purpose implementations of various cryptographic algorithms. Security Fix(es):
- libgcrypt: ElGamal implementation allows plaintext recovery (CVE-2021-40528) For more details about the security issue(s), including the impact, a CVSS score, acknowledgments, and other related information, refer to the CVE page(s) listed in the References section.
- Record
ALSA-2022:5311- Updated
- 2026-11-02
OSVCLSA-2023-1698945053 No score
libgcrypt: Fix of 4 CVEs
- CVE-2013-4576: Normalize the MPIs to prevent possible side-channel attacks
- CVE-2014-3591: Use ciphertext blinding for Elgamal to prevent possible side-channel attacks
- CVE-2021-33560: Use of smaller K for ephemeral key in ElGamal prevent generation of weak keys
- CVE-2021-40528: Add exponent blinding as well to mitigate side-channel attack on mpi_powm
- tests: Add a benchmark for Elgamal
- Record
CLSA-2023-1698945053- Updated
- 2026-11-02
OSVCLSA-2026-1782731604 No score
libgcrypt: Fix of CVE-2021-33560
- CVE-2013-4576: Normalize the MPIs to prevent possible side-channel attacks
- CVE-2014-3591: Use ciphertext blinding for Elgamal to prevent possible side-channel attacks
- CVE-2021-33560: Use of smaller K for ephemeral key in ElGamal prevent generation of weak keys
- CVE-2021-40528: Add exponent blinding as well to mitigate side-channel attack on mpi_powm
- tests: Add a benchmark for Elgamal
- Record
CLSA-2026-1782731604- Updated
- 2026-11-02
OSVMGASA-2021-0446 No score
Updated libgcrypt packages fix security vulnerability
The updated packages fix a security vulnerability:
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 (CVE-2021-40528).
- Record
MGASA-2021-0446- Updated
- 2026-11-02
OSVopenSUSE-SU-2024:12540-1 No score
libgcrypt-devel-1.10.1-1.1 on GA media
These are all security issues fixed in the libgcrypt-devel-1.10.1-1.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2024:12540-1- Updated
- 2026-11-02
OSVUSN-5080-1 No score
libgcrypt20 vulnerabilities
It was discovered that Libgcrypt incorrectly handled ElGamal encryption. An attacker could possibly use this issue to recover sensitive information.
- Record
USN-5080-1- Updated
- 2026-11-02
OSVUSN-5080-2 No score
libgcrypt20 vulnerabilities
USN-5080-1 fixed several vulnerabilities in Libgcrypt. This update provides the corresponding update for Ubuntu 16.04 ESM.
Original advisory details:
It was discovered that Libgcrypt incorrectly handled ElGamal encryption. An attacker could possibly use this issue to recover sensitive information.
- Record
USN-5080-2- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
libgcryptAlpine:v3.11 |
before 1.8.8-r1 | 1.8.8-r1 |
libgcryptAlpine:v3.12 |
before 1.8.8-r1 | 1.8.8-r1 |
libgcryptAlpine:v3.13 |
before 1.8.8-r1 | 1.8.8-r1 |
libgcryptAlmaLinux:8 |
before 1.8.5-7.el8_6 | 1.8.5-7.el8_6 |
libgcrypt-develAlmaLinux:8 |
before 1.8.5-7.el8_6 | 1.8.5-7.el8_6 |
libgcryptTuxCare:CentOS:7 From an advisory covering 4 CVEs |
before 1.5.3-14.el7.tuxcare.els1 | 1.5.3-14.el7.tuxcare.els1 |
libgcrypt-develTuxCare:CentOS:7 From an advisory covering 4 CVEs |
before 1.5.3-14.el7.tuxcare.els1 | 1.5.3-14.el7.tuxcare.els1 |
libgcryptTuxCare:OracleLinux:7 From an advisory covering 4 CVEs |
before 1.5.3-14.el7.tuxcare.els1 | 1.5.3-14.el7.tuxcare.els1 |
libgcrypt-develTuxCare:OracleLinux:7 From an advisory covering 4 CVEs |
before 1.5.3-14.el7.tuxcare.els1 | 1.5.3-14.el7.tuxcare.els1 |
libgcrypt20Debian:12 |
before 1.8.7-6 | 1.8.7-6 |
Show 25 moreShow less
| Package | Affected | Fixed |
|---|---|---|
libgcrypt20Debian:13 |
before 1.8.7-6 | 1.8.7-6 |
libgcrypt20Debian:14 |
before 1.8.7-6 | 1.8.7-6 |
libgcrypt20Debian:9 |
before 1.7.6-2+deb9u4, plus listed versions 1.7.6-21.7.6-2+deb9u11.7.6-2+deb9u21.7.6-2+deb9u3 |
1.7.6-2+deb9u4 |
Libgcrypt_jllJulia |
before 1.11.0+0 | 1.11.0+0 |
libgcryptMageia:8 |
before 1.8.7-1.2.mga8 | 1.8.7-1.2.mga8 |
libgcryptopenEuler:20.03-LTS-SP1 |
before 1.8.6-4.oe1 | 1.8.6-4.oe1 |
libgcryptopenEuler:20.03-LTS-SP2 |
before 1.8.6-4.oe1 | 1.8.6-4.oe1 |
libgcryptRed Hat:enterprise_linux:8::baseos |
before 0:1.8.5-7.el8_6 | 0:1.8.5-7.el8_6 |
libgcrypt-debuginfoRed Hat:enterprise_linux:8::baseos |
before 0:1.8.5-7.el8_6 | 0:1.8.5-7.el8_6 |
libgcrypt-debugsourceRed Hat:enterprise_linux:8::baseos |
before 0:1.8.5-7.el8_6 | 0:1.8.5-7.el8_6 |
libgcrypt-develRed Hat:enterprise_linux:8::baseos |
before 0:1.8.5-7.el8_6 | 0:1.8.5-7.el8_6 |
libgcrypt-devel-debuginfoRed Hat:enterprise_linux:8::baseos |
before 0:1.8.5-7.el8_6 | 0:1.8.5-7.el8_6 |
libgcryptRocky Linux:8 |
before 0:1.8.5-7.el8_6 | 0:1.8.5-7.el8_6 |
libgcrypt20Ubuntu:Pro:16.04:LTS |
before 1.6.5-2ubuntu0.6+esm1, plus listed versions 1.6.3-2ubuntu11.6.4-31.6.4-41.6.4-51.6.5-2 Show 5 moreShow less1.6.5-2ubuntu0.21.6.5-2ubuntu0.31.6.5-2ubuntu0.41.6.5-2ubuntu0.51.6.5-2ubuntu0.6 |
1.6.5-2ubuntu0.6+esm1 |
libgcrypt20Ubuntu:18.04:LTS |
before 1.8.1-4ubuntu1.3, plus listed versions 1.7.8-2ubuntu11.7.9-11.8.1-41.8.1-4ubuntu11.8.1-4ubuntu1.11.8.1-4ubuntu1.2 |
1.8.1-4ubuntu1.3 |
libgcrypt20Ubuntu:Pro:FIPS-updates:18.04:LTS |
before 1.8.1-4ubuntu1.fips.3, plus listed versions 1.8.1-4ubuntu1.fips.2.41.8.1-4ubuntu1.fips.2.5 |
1.8.1-4ubuntu1.fips.3 |
libgcrypt20Ubuntu:Pro:FIPS:18.04:LTS |
All versions, plus listed versions 1.8.1-4ubuntu1.fips.2.41.8.1-4ubuntu1.fips.2.5 |
None known |
libgcrypt20Ubuntu:20.04:LTS |
before 1.8.5-5ubuntu1.1, plus listed versions 1.8.4-5ubuntu21.8.5-3ubuntu11.8.5-5ubuntu1 |
1.8.5-5ubuntu1.1 |
libgcrypt20Ubuntu:Pro:FIPS-updates:20.04:LTS |
before 1.8.5-5ubuntu1.fips.1.1 | 1.8.5-5ubuntu1.fips.1.1 |
libgcrypt20Ubuntu:Pro:FIPS:20.04:LTS |
before 1.8.5-5ubuntu1.fips.1.1 | 1.8.5-5ubuntu1.fips.1.1 |
libgcrypt20Ubuntu:22.04:LTS |
before 1.8.7-5ubuntu2 | 1.8.7-5ubuntu2 |
libgcrypt20Ubuntu:18.04:LTS From an advisory covering 2 CVEs |
before 1.8.1-4ubuntu1.3, plus listed versions 1.7.8-2ubuntu11.7.9-11.8.1-41.8.1-4ubuntu11.8.1-4ubuntu1.11.8.1-4ubuntu1.2 |
1.8.1-4ubuntu1.3 |
libgcrypt20Ubuntu:20.04:LTS From an advisory covering 2 CVEs |
before 1.8.5-5ubuntu1.1, plus listed versions 1.8.4-5ubuntu21.8.5-3ubuntu11.8.5-5ubuntu1 |
1.8.5-5ubuntu1.1 |
libgcrypt20Ubuntu:Pro:16.04:LTS From an advisory covering 2 CVEs |
before 1.6.5-2ubuntu0.6+esm1, plus listed versions 1.6.3-2ubuntu11.6.4-31.6.4-41.6.4-51.6.5-2 Show 5 moreShow less1.6.5-2ubuntu0.21.6.5-2ubuntu0.31.6.5-2ubuntu0.41.6.5-2ubuntu0.51.6.5-2ubuntu0.6 |
1.6.5-2ubuntu0.6+esm1 |
libgcryptopenSUSE:Tumbleweed |
before 1.10.1-1.1 | 1.10.1-1.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| first indexed | CVE List, EUVD, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2021-40528 is a medium vulnerability (CVSS 5.9) in Gnupg Libgcrypt, published June 25, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.42%, the 73rd percentile. Fixed in libgcrypt 1.8.8-r1.
References
eprint.iacr.org/2021/923
ibm.github.io/system-security-research-updates/2021/07/20/insecurity-elgamal-pt1
ibm.github.io/system-security-research-updates/2021/09/06/insecurity-elgamal-pt2
git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git%3Ba=commit%3Bh=3462280f2e23e16adf3ed5176e0f2413d8861320
security.gentoo.org/glsa/202210-13
nvd.nist.gov/vuln/detail/CVE-2021-40528
Show 26 moreShow less
git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=commit;h=3462280f2e23e16adf3ed5176e0f2413d8861320
github.com/advisories/GHSA-8m2v-68m9-q2c7
security.alpinelinux.org/vuln/CVE-2021-40528
access.redhat.com/errata/RHSA-2022:5311
access.redhat.com/security/cve/CVE-2021-40528
bugzilla.redhat.com/2002816
errata.almalinux.org/8/ALSA-2022-5311.html
docs.bell-sw.com/security/cves/CVE-2021-40528
errata.cloudlinux.com/centos7-els/CLSA-2023-1698945053.html
errata.tuxcare.com/els_os/oraclelinux7els/CLSA-2026-1782731604.html
nvd.nist.gov/vuln/detail/CVE-2021-33560
security-tracker.debian.org/tracker/CVE-2021-40528
advisories.mageia.org/MGASA-2021-0446.html
bugs.mageia.org/show_bug.cgi?id=29467
ubuntu.com/security/notices/USN-5080-1
openeuler.org/en/security/safety-bulletin/detail.html?id=openEuler-SA-2021-1362
access.redhat.com/security/updates/classification
bugzilla.redhat.com/show_bug.cgi?id=2002816
security.access.redhat.com/data/csaf/v2/advisories/2022/rhsa-2022_5311.json
cve.org/CVERecord?id=CVE-2021-40528
dev.gnupg.org/rCb118681ebc4c9ea4b9da79b0f9541405a64f4c13
errata.rockylinux.org/RLSA-2022:5311
ubuntu.com/security/CVE-2021-40528
ubuntu.com/security/notices/USN-5080-2
ubuntu.com/security/CVE-2021-33560
suse.com/security/cve/CVE-2021-40528