CVE-2025-7844
Unknown Unknown - Not Provided
BaseFortify

Publication date: 2025-08-04

Last updated on: 2025-08-05

Assigner: wolfSSL Inc.

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.
CVSS Scores
EPSS Scores
Probability:
Percentile:
Meta Information
Published
2025-08-04
Last Modified
2025-08-05
Generated
2026-05-07
AI Q&A
2025-08-05
EPSS Evaluated
2026-05-05
NVD
EUVD
Affected Vendors & Products
Showing 1 associated CPE
Vendor Product Version / Range
wolfssl wolftpm *
Helpful Resources
Exploitability
CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-121 A stack-based buffer overflow condition is a condition where the buffer being overwritten is allocated on the stack (i.e., is a local variable or, rarely, a parameter to a function).
Attack-Flow Graph
AI Powered Q&A
Can you explain this vulnerability to me?

This vulnerability occurs when exporting a TPM-based RSA key larger than 2048 bits from the TPM using wolfTPM2_RsaKey_TpmToWolf function. If the default MAX_RSA_KEY_BITS=2048 is used and the TPM hardware supports larger keys, a stack buffer overrun can happen because the buffer size is insufficient for keys larger than 2048 bits. This can lead to memory corruption. The issue can be avoided by setting the MAX_RSA_KEY_BITS macro correctly to match the hardware capabilities.


How can this vulnerability impact me? :

The vulnerability can cause a stack buffer overrun when handling RSA keys larger than 2048 bits, potentially leading to memory corruption or unexpected behavior in applications using the affected TPM module. This could affect the stability or security of the system relying on these cryptographic operations.


What immediate steps should I take to mitigate this vulnerability?

Ensure that the build-time macro MAX_RSA_KEY_BITS is set correctly to match the RSA key size supported by your TPM hardware (2048 bits or less if the hardware does not support larger keys). Avoid exporting TPM based RSA keys larger than 2048 bits unless your TPM and application fully support it with the correct configuration. This prevents the stack buffer overrun vulnerability.


Ask Our AI Assistant
Need more information? Ask your question to get an AI reply (Powered by our expertise)
0/70
EPSS Chart