Skip to main content

CVE-2025-7844: CWE-121 in wolfSSL Inc. wolfTPM

Low
VulnerabilityCVE-2025-7844cvecve-2025-7844cwe-121
Published: Mon Aug 04 2025 (08/04/2025, 21:35:04 UTC)
Source: CVE Database V5
Vendor/Project: wolfSSL Inc.
Product: wolfTPM

Description

Exporting a TPM based RSA key larger than 2048 bits from the TPM could overrun a stack buffer if the default `MAX_RSA_KEY_BITS=2048` is used. If your TPM 2.0 module supports RSA key sizes larger than 2048 bit and your applications supports creating or importing an RSA private or public key larger than 2048 bits and your application calls `wolfTPM2_RsaKey_TpmToWolf` on that key, then a stack buffer could be overrun. If the `MAX_RSA_KEY_BITS` build-time macro is set correctly (RSA bits match what TPM hardware is capable of) for the hardware target, then a stack overrun is not possible.

AI-Powered Analysis

AILast updated: 08/04/2025, 22:02:57 UTC

Technical Analysis

CVE-2025-7844 is a stack-based buffer overflow vulnerability classified under CWE-121, affecting the wolfTPM component of wolfSSL Inc.'s cryptographic library. The vulnerability arises when exporting a TPM-based RSA key larger than 2048 bits from a TPM 2.0 module, if the wolfTPM library is built with the default macro MAX_RSA_KEY_BITS set to 2048. Specifically, if the TPM hardware supports RSA keys larger than 2048 bits and the application creates or imports such keys, calling the wolfTPM2_RsaKey_TpmToWolf function on these keys can cause a stack buffer overrun. This occurs because the buffer size allocated for the RSA key export is insufficient to handle keys larger than 2048 bits, leading to potential memory corruption. However, if the MAX_RSA_KEY_BITS macro is correctly configured at build time to match the hardware capabilities of the TPM module, this overflow condition is prevented. The vulnerability has a low CVSS 4.0 score of 1.0, reflecting its limited attack surface and complexity. Exploitation requires a local attacker with access to the TPM and the ability to invoke the vulnerable function with oversized RSA keys. No known exploits are reported in the wild. The flaw primarily impacts applications that utilize wolfTPM for TPM 2.0 RSA key management and that handle RSA keys exceeding 2048 bits without proper build-time configuration. This vulnerability highlights the importance of aligning software build parameters with hardware capabilities to avoid buffer overflows in cryptographic operations.

Potential Impact

For European organizations, the impact of CVE-2025-7844 is generally low but context-dependent. Organizations using wolfSSL's wolfTPM library in their security infrastructure, particularly those employing TPM 2.0 modules with support for RSA keys larger than 2048 bits, could face risks of application crashes or memory corruption due to stack buffer overruns. While the vulnerability does not directly lead to privilege escalation or remote code execution without additional conditions, it could be leveraged by a local attacker or malicious insider to disrupt cryptographic operations or cause denial of service in security-critical applications. This may affect systems relying on TPM for secure key storage, attestation, or cryptographic functions, potentially undermining trust in hardware-based security modules. Given the low CVSS score and the requirement for specific build-time misconfiguration, widespread impact is unlikely. However, sectors with stringent security requirements, such as finance, government, and critical infrastructure in Europe, should be cautious. The vulnerability could also complicate compliance with European data protection regulations if it leads to cryptographic failures or data exposure indirectly. Overall, the threat is limited but warrants attention in environments where TPM-based RSA keys larger than 2048 bits are used with wolfTPM.

Mitigation Recommendations

To mitigate CVE-2025-7844, European organizations should take the following specific actions: 1) Review and audit all builds of wolfTPM to ensure that the MAX_RSA_KEY_BITS macro is explicitly set to match the maximum RSA key size supported by the deployed TPM hardware, avoiding the default 2048-bit setting if larger keys are used. 2) Conduct a thorough inventory of applications and systems utilizing wolfTPM for TPM 2.0 RSA key management, identifying those that create or import RSA keys larger than 2048 bits. 3) Apply patches or rebuild wolfTPM libraries with the correct MAX_RSA_KEY_BITS configuration as soon as possible. 4) Implement runtime monitoring for abnormal application crashes or memory corruption events related to TPM operations, which could indicate exploitation attempts. 5) Restrict access to TPM interfaces and wolfTPM function calls to trusted users and processes to reduce the risk of local exploitation. 6) Engage with wolfSSL support or security advisories for any forthcoming patches or updates addressing this vulnerability. 7) For new deployments, consider limiting RSA key sizes to 2048 bits unless larger keys are strictly necessary and the software environment is properly configured. These steps go beyond generic advice by focusing on build-time configuration alignment, targeted inventory, and runtime detection specific to this vulnerability.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
wolfSSL
Date Reserved
2025-07-18T20:01:35.602Z
Cvss Version
4.0
State
PUBLISHED

Threat ID: 68912a7dad5a09ad00e3496b

Added to database: 8/4/2025, 9:47:41 PM

Last enriched: 8/4/2025, 10:02:57 PM

Last updated: 8/4/2025, 10:02:57 PM

Views: 2

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats