CVE Details
Basic Information
| Title | wolfTPM library wrapper function `wolfTPM2_RsaKey_TpmToWolf` copies external data to a fixed-size stack buffer without length validation potentially causing stack-based buffer overflow |
|---|---|
| Type | cve |
| Published | 2025-08-04T21:35:04.013Z |
| Modified | 2025-08-04T21:35:04.013Z |
Product Information
| Vendor | wolfSSL Inc. |
|---|---|
| Product | wolfTPM |
| Version | 0 |
CVSS Information
| Base Score | 1.0 (LOW) |
|---|---|
| Attack Vector | CVSS:4.0/AV:P/AC:H/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:L/U:Green |
AI Analysis
| AI Description | A buffer overflow vulnerability in the wolfTPM library’s `wolfTPM2_RsaKey_TpmToWolf` function can occur when handling RSA keys larger than 2048 bits, potentially leading to a stack-based buffer overflow. This could result in application crashes or arbitrary code execution under specific conditions. |
|---|---|
| AI Severity | Medium |
| AI Vendor | wolfSSL Inc. |
| AI Product | wolfTPM |
| AI Version | 0 |
Affected Products
- wolfSSL Inc. wolfTPM 0
Additional Information
| CWE List | CWE-121 |
|---|---|
| Source | wolfSSL |
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.