CVE-2021-3505
A flaw was found in libtpms in versions before 0.8.0. The TPM 2 implementation returns 2048 bit...
A flaw was found in libtpms in versions before 0.8.0. The TPM 2 implementation returns 2048 bit keys with ~1984 bit strength due to a bug in the TCG specification. The bug is in the key creation algorithm in RsaAdjustPrimeCandidate(), which is called before the prime number check. The highest threat from this vulnerability is to data confidentiality.
Attack profile
How easy it is to exploit
- Attack vector
- Local
- Complexity
- Low
- Privileges needed
- Low
- User interaction
- None
What an attacker can affect
- Confidentiality
- High
- Integrity
- None
- Availability
- None
Exploit likelihood
What each source reports
NVD Score used
5.5
A flaw was found in libtpms in versions before 0.8.0. The TPM 2 implementation returns 2048 bit keys with ~1984 bit strength due to a bug in the TCG specification. The bug is in the key creation algorithm in RsaAdjustPrimeCandidate(), which is called before the prime number check. The highest threat from this vulnerability is to data confidentiality.
- Record
CVE-2021-3505- CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N - CVSS 2.0
- 2.1 Low
AV:L/AC:L/Au:N/C:P/I:N/A:N - Weakness
- CWE-331
- Updated
- 2026-11-02
CVE List No score
A flaw was found in libtpms in versions before 0.8.0. The TPM 2 implementation returns 2048 bit keys with ~1984 bit strength due to a bug in the TCG specification. The bug is in the key creation algorithm in RsaAdjustPrimeCandidate(), which is called before the prime number check. The highest threat from this vulnerability is to data confidentiality.
- Record
CVE-2021-3505- Weakness
- CWE-331
- Updated
- 2026-11-02
EUVDEUVD-2021-26824 No score
A flaw was found in libtpms in versions before 0.8.0. The TPM 2 implementation returns 2048 bit keys with ~1984 bit strength due to a bug in the TCG specification. The bug is in the key creation algorithm in RsaAdjustPrimeCandidate(), which is called before the prime number check. The highest threat from this vulnerability is to data confidentiality.
- Record
EUVD-2021-26824- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-239j-gmhr-4pcm No score
A flaw was found in libtpms in versions before 0.8.0. The TPM 2 implementation returns 2048 bit...
A flaw was found in libtpms in versions before 0.8.0. The TPM 2 implementation returns 2048 bit keys with ~1984 bit strength due to a bug in the TCG specification. The bug is in the key creation algorithm in RsaAdjustPrimeCandidate(), which is called before the prime number check. The highest threat from this vulnerability is to data confidentiality.
- Record
GHSA-239j-gmhr-4pcm- Weakness
- CWE-331
- Updated
- 2026-11-02
OSV
5.5
A flaw was found in libtpms in versions before 0.8.0. The TPM 2 implementation returns 2048 bit keys with ~1984 bit strength due to a bug in the TCG specification. The bug is in the key creation algorithm in RsaAdjustPrimeCandidate(), which is called before the prime number check. The highest threat from this vulnerability is to data confidentiality.
- Record
CVE-2021-3505- CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
OSVDEBIAN-CVE-2021-3505
5.5
A flaw was found in libtpms in versions before 0.8.0. The TPM 2 implementation returns 2048 bit keys with ~1984 bit strength due to a bug in the TCG specification. The bug is in the key creation algorithm in RsaAdjustPrimeCandidate(), which is called before the prime number check. The highest threat from this vulnerability is to data confidentiality.
- Record
DEBIAN-CVE-2021-3505- CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N - Updated
- 2026-11-02
OSVOESA-2022-1959
5.5
libtpms security update
A library providing TPM functionality for VMs. Targeted for integration into Qemu.
Security Fix(es):
A flaw was found in libtpms in versions before 0.8.0. The TPM 2 implementation returns 2048 bit keys with ~1984 bit strength due to a bug in the TCG specification. The bug is in the key creation algorithm in RsaAdjustPrimeCandidate(), which is called before the prime number check. The highest threat from this vulnerability is to data confidentiality.(CVE-2021-3505)
- Record
OESA-2022-1959- CVSS 3.1
- 5.5 Medium
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVMGASA-2021-0590 No score
Updated libtpms/swtpm packages fix security vulnerability
CryptSym: fix AES output IV (CVE-2021-3505). Fixed a context save and suspend/resume problem when public keys are loaded. Reset too large size indicators in TPM2B to avoid access beyond buffer (CVE-2021-3623) Restore original value in buffer if unmarshalled one was illegal Fixed out-of-bounds access via specially crafted TPM 2 command packets (CVE-2021-3746) Marshal event sequence objects' hash state
- Record
MGASA-2021-0590- Updated
- 2026-11-02
OSVopenSUSE-SU-2024:11004-1 No score
libtpms-devel-0.8.4-2.2 on GA media
These are all security issues fixed in the libtpms-devel-0.8.4-2.2 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2024:11004-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
libtpmsDebian:12 |
before 0.8.0~dev1-1 | 0.8.0~dev1-1 |
libtpmsDebian:13 |
before 0.8.0~dev1-1 | 0.8.0~dev1-1 |
libtpmsDebian:14 |
before 0.8.0~dev1-1 | 0.8.0~dev1-1 |
libtpmsMageia:8 From an advisory covering 4 CVEs |
before 0.9.1-1.mga8 | 0.9.1-1.mga8 |
swtpmMageia:8 From an advisory covering 4 CVEs |
before 0.7.0-5.mga8 | 0.7.0-5.mga8 |
libtpmsopenEuler:20.03-LTS-SP1 |
before 0.7.3-7.oe1 | 0.7.3-7.oe1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, facts | ||
| aliases, products | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2021-3505 is a medium vulnerability (CVSS 5.5) in Libtpms Project Libtpms, published April 19, 2021. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.40%, the 34th percentile. Fixed in libtpms 0.8.0~dev1-1.
References
bugzilla.redhat.com/show_bug.cgi?id=1950046
github.com/stefanberger/libtpms/issues/183
lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NUCZX4S53TUNTSGTCRDNOQZV2V2RI4RJ
nvd.nist.gov/vuln/detail/CVE-2021-3505
lists.fedoraproject.org/archives/list/[email protected]/message/NUCZX4S53TUNTSGTCRDNOQZV2V2RI4RJ
github.com/advisories/GHSA-239j-gmhr-4pcm
Show 14 moreShow less
security-tracker.debian.org/tracker/CVE-2021-3505
advisories.mageia.org/MGASA-2021-0590.html
bugs.mageia.org/show_bug.cgi?id=28882
lists.fedoraproject.org/archives/list/[email protected]/thread/46YMIRHQHNKPCVNRVW4W27MFQQU7ZHHV
lists.fedoraproject.org/archives/list/[email protected]/thread/Z7KZSYMTE7Z4BBEZUWO2DIMQDWMGEP46
lists.fedoraproject.org/archives/list/[email protected]/thread/DZI42OR3JUEGWRKEVCOHL2FPTJVYCYBT
lists.fedoraproject.org/archives/list/[email protected]/thread/7UCZ7AV2UKWYYCNZ2NLLXW7QYCX7K337
lists.opensuse.org/archives/list/[email protected]/thread/75RD2O2OFCMWPCMY5QMSZRNV5PG5BTS6
lists.fedoraproject.org/archives/list/[email protected]/thread/YVJSXDXD44WDR4VA2XL33IZDJTBGRXP7
lists.fedoraproject.org/archives/list/[email protected]/thread/7E3B6T5RBDKAWETDTW3WPORY3NK5IR46
openeuler.org/en/security/safety-bulletin/detail.html?id=openEuler-SA-2022-1959
suse.com/security/cve/CVE-2021-3446
suse.com/security/cve/CVE-2021-3505
suse.com/security/cve/CVE-2021-3746