Register for the AI for Security Summit: Join Figma, Perplexity & Wiz

CVE-2025-52497
Mbed TLS vulnerability analysis and mitigation

Overview

CVE-2025-52497 is a heap buffer under-read vulnerability in Mbed TLS affecting all versions up to and including 3.6.3. The flaw exists in the PEM parsing code — specifically in mbedtls_pem_read_buffer, mbedtls_pk_parse_key, and mbedtls_pk_parse_keyfile — where processing invalid PEM-encrypted material can cause the decryption code to read one byte before the beginning of a heap-allocated buffer. It was discovered and reported by Linh Le and Ngan Nguyen from Calif., with the advisory published on June 30, 2025, and the CVE assigned on July 4, 2025. The vulnerability carries a CVSS v3.1 base score of 4.8 (Medium) (Mbed TLS Advisory, Red Hat CVE).

Technical details

The root cause is an off-by-one error (CWE-193) in the PEM decryption path: when parsing invalid PEM-encrypted input with a non-NULL password argument, the code calculates an incorrect buffer offset and reads one byte before the start of a heap buffer that was allocated within the same function. This constitutes a one-byte heap-based buffer under-read (CWE-127 per the vendor advisory). Exploitation requires the attacker to supply untrusted PEM-encrypted material to an application that calls one of the three affected functions with a non-NULL password; applications built with MBEDTLS_PEM_C disabled are not affected. No public proof-of-concept exploit code has been identified (Mbed TLS Advisory).

Impact

Successful exploitation typically results in a Denial of Service due to the invalid memory read, or limited information disclosure by exposing one byte of heap memory adjacent to the allocated buffer. The vulnerability is network-reachable (attack vector: Network) but requires high attack complexity, and there is no integrity impact. The confidentiality and availability impacts are both rated Low, limiting the practical severity to scenarios where an attacker can supply crafted PEM input to a vulnerable application (Mbed TLS Advisory, Red Hat CVE).

Exploitability

No public exploit code or in-the-wild exploitation has been reported for CVE-2025-52497. The EPSS score is approximately 0.043%, indicating a very low probability of exploitation in the near term. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. Detection signatures have been published by Qualys and Nessus, and the vulnerability has been indexed by multiple security databases (Red Hat CVE).

Exploitation steps

  1. Identify target application: Locate an application using Mbed TLS ≤ 3.6.3 that accepts untrusted PEM-encrypted input and calls mbedtls_pk_parse_key(), mbedtls_pk_parse_keyfile(), or mbedtls_pem_read_buffer() with a non-NULL password argument (e.g., a TLS server accepting client certificates or a key management service).
  2. Craft malformed PEM input: Construct an invalid PEM-encrypted payload — for example, a PEM block with a malformed or truncated encrypted key body — designed to trigger the off-by-one error in the decryption buffer offset calculation.
  3. Submit the payload: Deliver the crafted PEM input to the target application through whatever interface accepts it (e.g., a TLS handshake, file upload, API endpoint, or configuration parser).
  4. Trigger the under-read: The vulnerable parsing code reads one byte before the start of the heap-allocated buffer, potentially causing a crash (DoS) or leaking one byte of adjacent heap memory.
  5. Observe outcome: Monitor for application crashes (DoS) or, in a more targeted scenario, attempt to infer heap layout to extract the leaked byte for limited information disclosure (Mbed TLS Advisory).

Indicators of compromise

  • Logs: Application crash logs or core dumps originating from mbedtls_pem_read_buffer, mbedtls_pk_parse_key, or mbedtls_pk_parse_keyfile functions; heap corruption error messages from the Mbed TLS library.
  • Network: Repeated or anomalous TLS handshake failures or connection resets from a single source IP, particularly involving malformed certificate or key material submissions.
  • Process: Unexpected process crashes or restarts of services using Mbed TLS when processing PEM-formatted input; memory sanitizer (ASan/Valgrind) reports of heap buffer under-reads in Mbed TLS parsing functions.

Mitigation and workarounds

Users should upgrade to Mbed TLS 3.6.4 or later, which resolves the off-by-one error in the PEM parsing code. The upcoming TF-PSA-Crypto 1.0 release will also include the fix. As a workaround, applications that do not process untrusted PEM-encrypted material (i.e., those that always pass a NULL password to the affected functions) are not vulnerable; additionally, building with MBEDTLS_PEM_C disabled eliminates the attack surface entirely. Debian LTS users should apply the security update published in August 2025 (DLA-4274-1), and Ubuntu users should apply USN-8123-1 (Mbed TLS Advisory, Red Hat CVE).

Community reactions

The vulnerability was discovered through a security audit of Mbed TLS conducted in partnership with Google, as noted in a blog post by the reporting researchers from Calif. (Calif. Blog). Red Hat has acknowledged the vulnerability and published a CVE tracking page. The security community response has been measured given the Medium severity rating, with standard distribution through vulnerability databases and scanner plugin updates from Qualys and Nessus. No significant controversy or widespread media coverage has been observed.

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Fixed

bookworm

mbedtls

Affected

sid

mbedtls: 3.6.4-1

Fixed

trixie

mbedtls: 3.6.4-1

Fixed

Ubuntu

Fixed

bionic (esm-apps)

mbedtls: 2.8.0-1ubuntu0.1~esm1

Fixed

devel

mbedtls

Not Affected

focal (esm-apps)

mbedtls: 2.16.4-1ubuntu2+esm1

Fixed

jammy

mbedtls

Affected

jammy (esm-apps)

mbedtls: 2.28.0-1ubuntu0.1~esm1

Fixed

noble

mbedtls

Affected

noble (esm-apps)

mbedtls: 2.28.8-1ubuntu0.1~esm1

Fixed

resolute

mbedtls

Not Affected

Alpine

Fixed

edge

mbedtls3: 3.6.4-r0

Fixed

v3.20

mbedtls: 3.6.4-r0

Fixed

v3.21

mbedtls: 3.6.4-r0

Fixed

v3.22

mbedtls: 3.6.4-r0

Fixed

v3.23

mbedtls: 3.6.4-r0

Fixed

SourceThis report was generated using AI

Related Mbed TLS vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-25832LOW3.7
  • Mbed TLS logoMbed TLS
  • mbedtls-debuginfo
NoYesSep 14, 2026
CVE-2026-54441NONEN/A
  • Mbed TLS logoMbed TLS
  • mbedtls
NoYesJul 23, 2026
CVE-2026-54435NONEN/A
  • Mbed TLS logoMbed TLS
  • mbedtls
NoYesJul 23, 2026
CVE-2026-50713NONEN/A
  • Mbed TLS logoMbed TLS
  • mbedtls-doc
NoYesJul 23, 2026
CVE-2026-50640NONEN/A
  • Mbed TLS logoMbed TLS
  • mbedtls
NoYesJul 23, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management