CVE-2023-22745: CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') in tpm2-software tpm2-tss
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.
AI Analysis
Technical Summary
CVE-2023-22745 is a classic buffer overflow vulnerability (CWE-120) identified in the tpm2-tss open source software stack, which implements the Trusted Platform Module (TPM) 2.0 software interface. The vulnerability exists in the functions Tss2_RC_SetHandler and Tss2_RC_Decode, which handle response code layers by indexing into the layer_handler array using an 8-bit layer number. However, the array size is limited to TPM2_ERROR_TSS2_RC_LAYER_COUNT entries, and when a layer number exceeds this count, the code reads or writes beyond the array boundary, causing a buffer overrun. This memory corruption can lead to arbitrary code execution if exploited. An example attack vector includes a man-in-the-middle (MiTM) bus attack that returns a crafted response code such as 0xFFFFFFFF, triggering the overflow. Exploitation requires local system privileges with administrative rights to access the TPM interface, which is typically restricted. The vulnerability affects tpm2-tss versions prior to 4.1.0-rc0, 4.0.1, and 3.2.2-rc1, all of which contain patches to prevent this out-of-bounds access. The CVSS v3.1 score is 6.4 (medium severity), reflecting the need for high privileges and the complexity of exploitation. No known exploits have been reported in the wild to date. Given the widespread use of TPM modules for hardware-based security functions such as secure boot, disk encryption, and platform integrity verification, this vulnerability poses a significant risk if left unpatched, especially in environments where attackers can gain local administrative access.
Potential Impact
For European organizations, the impact of CVE-2023-22745 can be significant due to the reliance on TPM modules for securing sensitive operations including cryptographic key storage, device attestation, and secure boot processes. Successful exploitation could allow an attacker with local administrative access to execute arbitrary code within the TPM software stack context, potentially compromising the integrity and confidentiality of cryptographic operations and sensitive data. This could lead to unauthorized access to encrypted data, bypassing of platform security controls, and persistence mechanisms that evade detection. Critical sectors such as finance, government, healthcare, and critical infrastructure, which often mandate TPM usage for compliance and security, are particularly at risk. The requirement for local administrative privileges limits remote exploitation but does not eliminate risk from insider threats, compromised endpoints, or attackers who gain physical or remote administrative access through other means. The vulnerability could also undermine trust in hardware-based security assurances, impacting supply chain security and regulatory compliance across the EU.
Mitigation Recommendations
To mitigate CVE-2023-22745, European organizations should: 1) Immediately upgrade tpm2-tss to versions 4.1.0-rc0, 4.0.1, 3.2.2-rc1 or later where the vulnerability is patched. 2) Restrict local administrative access to systems with TPM modules, enforcing strict access controls and monitoring for unauthorized privilege escalation. 3) Implement endpoint detection and response (EDR) solutions to detect anomalous behavior indicative of exploitation attempts targeting TPM interfaces. 4) Harden physical and logical security controls to prevent unauthorized local access, including secure boot and BIOS/UEFI password protections. 5) Regularly audit TPM usage and software stack versions across the enterprise to ensure compliance with security policies. 6) Educate system administrators and security teams about the risks associated with TPM vulnerabilities and the importance of timely patching. 7) Consider network segmentation and isolation of critical systems to limit lateral movement if local compromise occurs. These steps go beyond generic advice by focusing on the unique access requirements and security context of TPM components.
Affected Countries
Germany, France, United Kingdom, Netherlands, Sweden, Finland, Italy, Spain
CVE-2023-22745: CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow') in tpm2-software tpm2-tss
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.
AI-Powered Analysis
Technical Analysis
CVE-2023-22745 is a classic buffer overflow vulnerability (CWE-120) identified in the tpm2-tss open source software stack, which implements the Trusted Platform Module (TPM) 2.0 software interface. The vulnerability exists in the functions Tss2_RC_SetHandler and Tss2_RC_Decode, which handle response code layers by indexing into the layer_handler array using an 8-bit layer number. However, the array size is limited to TPM2_ERROR_TSS2_RC_LAYER_COUNT entries, and when a layer number exceeds this count, the code reads or writes beyond the array boundary, causing a buffer overrun. This memory corruption can lead to arbitrary code execution if exploited. An example attack vector includes a man-in-the-middle (MiTM) bus attack that returns a crafted response code such as 0xFFFFFFFF, triggering the overflow. Exploitation requires local system privileges with administrative rights to access the TPM interface, which is typically restricted. The vulnerability affects tpm2-tss versions prior to 4.1.0-rc0, 4.0.1, and 3.2.2-rc1, all of which contain patches to prevent this out-of-bounds access. The CVSS v3.1 score is 6.4 (medium severity), reflecting the need for high privileges and the complexity of exploitation. No known exploits have been reported in the wild to date. Given the widespread use of TPM modules for hardware-based security functions such as secure boot, disk encryption, and platform integrity verification, this vulnerability poses a significant risk if left unpatched, especially in environments where attackers can gain local administrative access.
Potential Impact
For European organizations, the impact of CVE-2023-22745 can be significant due to the reliance on TPM modules for securing sensitive operations including cryptographic key storage, device attestation, and secure boot processes. Successful exploitation could allow an attacker with local administrative access to execute arbitrary code within the TPM software stack context, potentially compromising the integrity and confidentiality of cryptographic operations and sensitive data. This could lead to unauthorized access to encrypted data, bypassing of platform security controls, and persistence mechanisms that evade detection. Critical sectors such as finance, government, healthcare, and critical infrastructure, which often mandate TPM usage for compliance and security, are particularly at risk. The requirement for local administrative privileges limits remote exploitation but does not eliminate risk from insider threats, compromised endpoints, or attackers who gain physical or remote administrative access through other means. The vulnerability could also undermine trust in hardware-based security assurances, impacting supply chain security and regulatory compliance across the EU.
Mitigation Recommendations
To mitigate CVE-2023-22745, European organizations should: 1) Immediately upgrade tpm2-tss to versions 4.1.0-rc0, 4.0.1, 3.2.2-rc1 or later where the vulnerability is patched. 2) Restrict local administrative access to systems with TPM modules, enforcing strict access controls and monitoring for unauthorized privilege escalation. 3) Implement endpoint detection and response (EDR) solutions to detect anomalous behavior indicative of exploitation attempts targeting TPM interfaces. 4) Harden physical and logical security controls to prevent unauthorized local access, including secure boot and BIOS/UEFI password protections. 5) Regularly audit TPM usage and software stack versions across the enterprise to ensure compliance with security policies. 6) Educate system administrators and security teams about the risks associated with TPM vulnerabilities and the importance of timely patching. 7) Consider network segmentation and isolation of critical systems to limit lateral movement if local compromise occurs. These steps go beyond generic advice by focusing on the unique access requirements and security context of TPM components.
Affected Countries
For access to advanced analysis and higher rate limits, contact root@offseq.com
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2023-01-06T14:21:05.893Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 6920bcb74429ea99a56abe0b
Added to database: 11/21/2025, 7:25:43 PM
Last enriched: 11/21/2025, 7:40:46 PM
Last updated: 11/21/2025, 11:37:51 PM
Views: 9
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Related Threats
CVE-2025-65947: CWE-400: Uncontrolled Resource Consumption in jzeuzs thread-amount
HighCVE-2025-65946: CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection') in RooCodeInc Roo-Code
HighCVE-2025-12678
UnknownCVE-2025-11933: CWE-20 Improper Input Validation in wofSSL wolfSSL
LowCVE-2025-65111: CWE-277: Insecure Inherited Permissions in authzed spicedb
LowActions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need enhanced features?
Contact root@offseq.com for Pro access with improved analysis and higher rate limits.