CVE-2023-22745 Buffer Overlow in TSS2_RC_Decode in tpm2-tss
A buffer overflow in tpm2-tss allows local attackers with TPM access to execute arbitrary code via crafted response codes.
- Exploited in the wild
- Not known
- Login needed
- An administrator
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2023-22745?
CVE-2023-22745 is a medium-severity memory corruption vulnerability in tpm2-software tpm2-tss, published on 19 Jan 2023. It can only be exploited from the same machine or local network, with no action from the victim.
Official description
tpm2-tss is an open source software implementation of the Trusted Computing Group (TCG) Trusted Platform Module (TPM) 2 Software Stack (TSS2). In versions prior to 4.1.0-rc0, 4.0.1, and 3.2.2-rc1, `Tss2_RC_SetHandler` and `Tss2_RC_Decode` both index into `layer_handler` with an 8 bit layer number, but the array only has `TPM2_ERROR_TSS2_RC_LAYER_COUNT` entries, so trying to add a handler for higher-numbered layers or decode a response code with such a layer number reads/writes past the end of the buffer. This Buffer overrun, could result in arbitrary code execution. An example attack would be a MiTM bus attack that returns 0xFFFFFFFF for the RC. Given the common use case of TPM modules an attacker must have local access to the target machine with local system privileges which allows access to the TPM system. Usually TPM access requires administrative privilege. Versions 4.1.0-rc0, 4.0.1, and 3.2.2-rc1 fix the issue.
Weakness: CWE-120
Which versions are affected by CVE-2023-22745?
It affects 1 product.
Linux distribution packages (36)
tpm2-tss AlmaLinux:8 | All versions | 2.3.2-5.el8 |
tpm2-tss-devel AlmaLinux:8 | All versions | 2.3.2-5.el8 |
tpm2-tss AlmaLinux:9 | All versions | 3.2.2-2.el9 |
tpm2-tss-devel AlmaLinux:9 | All versions | 3.2.2-2.el9 |
tpm2-tss Red Hat:enterprise_linux:8::baseos | All versions | 0:2.3.2-5.el8 |
tpm2-tss-debuginfo Red Hat:enterprise_linux:8::baseos | All versions | 0:2.3.2-5.el8 |
tpm2-tss-debugsource Red Hat:enterprise_linux:8::baseos | All versions | 0:2.3.2-5.el8 |
tpm2-tss-devel Red Hat:enterprise_linux:8::baseos | All versions | 0:2.3.2-5.el8 |
tpm2-tss Red Hat:enterprise_linux:9::baseos | All versions | 0:3.2.2-2.el9 |
tpm2-tss-debuginfo Red Hat:enterprise_linux:9::baseos | All versions | 0:3.2.2-2.el9 |
tpm2-tss-debugsource Red Hat:enterprise_linux:9::baseos | All versions | 0:3.2.2-2.el9 |
tpm2-tss-debuginfo Red Hat:enterprise_linux:9::crb | All versions | 0:3.2.2-2.el9 |
tpm2-tss-debugsource Red Hat:enterprise_linux:9::crb | All versions | 0:3.2.2-2.el9 |
tpm2-tss-devel Red Hat:enterprise_linux:9::crb | All versions | 0:3.2.2-2.el9 |
tpm2-tss Red Hat:rhel_aus:8.6::baseos | All versions | 0:2.3.2-5.el8_6 |
tpm2-tss-debuginfo Red Hat:rhel_aus:8.6::baseos | All versions | 0:2.3.2-5.el8_6 |
tpm2-tss-debugsource Red Hat:rhel_aus:8.6::baseos | All versions | 0:2.3.2-5.el8_6 |
tpm2-tss-devel Red Hat:rhel_aus:8.6::baseos | All versions | 0:2.3.2-5.el8_6 |
tpm2-tss Red Hat:rhel_e4s:8.6::baseos | All versions | 0:2.3.2-5.el8_6 |
tpm2-tss-debuginfo Red Hat:rhel_e4s:8.6::baseos | All versions | 0:2.3.2-5.el8_6 |
tpm2-tss-debugsource Red Hat:rhel_e4s:8.6::baseos | All versions | 0:2.3.2-5.el8_6 |
tpm2-tss-devel Red Hat:rhel_e4s:8.6::baseos | All versions | 0:2.3.2-5.el8_6 |
tpm2-tss Red Hat:rhel_eus:8.8::baseos | All versions | 0:2.3.2-5.el8_8 |
tpm2-tss-debuginfo Red Hat:rhel_eus:8.8::baseos | All versions | 0:2.3.2-5.el8_8 |
tpm2-tss-debugsource Red Hat:rhel_eus:8.8::baseos | All versions | 0:2.3.2-5.el8_8 |
tpm2-tss-devel Red Hat:rhel_eus:8.8::baseos | All versions | 0:2.3.2-5.el8_8 |
tpm2-tss Red Hat:rhel_tus:8.6::baseos | All versions | 0:2.3.2-5.el8_6 |
tpm2-tss-debuginfo Red Hat:rhel_tus:8.6::baseos | All versions | 0:2.3.2-5.el8_6 |
tpm2-tss-debugsource Red Hat:rhel_tus:8.6::baseos | All versions | 0:2.3.2-5.el8_6 |
tpm2-tss-devel Red Hat:rhel_tus:8.6::baseos | All versions | 0:2.3.2-5.el8_6 |
tpm2-0-tss SUSE:Linux Enterprise Micro 5.3 | All versions | 3.1.0-150400.3.3.1 |
tpm2-0-tss SUSE:Linux Enterprise Module for Basesystem 15 SP4 | All versions | 3.1.0-150400.3.3.1 |
tpm2-0-tss SUSE:Linux Enterprise Real Time 15 SP3 | All versions | 2.4.5-150300.3.6.1 |
tpm2-0-tss openSUSE:Leap 15.4 | All versions | 2.4.5-150300.3.6.1 |
tpm2-0-tss openSUSE:Leap 15.4 | All versions | 3.1.0-150400.3.3.1 |
tpm2-0-tss openSUSE:Leap Micro 5.3 | All versions | 3.1.0-150400.3.3.1 |
Products include Tpm2 Software Stack Project Tpm2 Software Stack.
How do I fix CVE-2023-22745?
Upgrade to a fixed version.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is CVE-2023-22745 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2023-22745 exists.
Sources
Also known as ALSA-2023:6685, ALSA-2023:7166, AZL-13055, AZL-69129, BELL-CVE-2023-22745, CLSA-2025-1760021057 and 12 more.