Security Advisory

CVE-2025-48965: Mbed TLS ASN.1 Named-Data NULL Pointer Dereference via Crafted Certificate Strings

Last updated:
  • CVE-2025-48965

CVE-2025-48965 is a NULL pointer dereference (CWE-476) in Mbed TLS, the widely embedded TLS and cryptography library used in countless firmware images on microcontrollers that lack an MMU or MPU: calling mbedtls_asn1_store_named_data() with a zero-length value for an OID that is already present in its output list leaves that list entry with a NULL data pointer but a nonzero recorded length, and later code that reads the list — directly, or indirectly through certificate/CSR subject- and issuer-name string parsing functions — dereferences that NULL pointer and crashes; NVD's own analysis rates this CVSS v3.1 7.5 (high), while Mbed TLS's own advisory rates it Medium.

Vulnerability summary

7.5

High

0.6%

EPSS score (FIRST)

No

CISA KEV catalog

2025-07-20

Published

Vulnerability ID: CVE-2025-48965 · Source: NVD

Affected components

ComponentCPEVersion range
Mbed TLS (ASN.1 named-data / X.509 subject-and-issuer name parsing)cpe:2.3:a:arm:mbed_tls:*:*:*:*:*:*:*:*Mbed TLS before 3.6.4 (fixed in 3.6.4)

What does this mean for affected devices?

CVE-2025-48965 (CWE-476, NULL pointer dereference) affects Mbed TLS, the lightweight, source-embedded TLS and cryptography library maintained by the Mbed TLS project (formerly ARM mbed TLS) that is compiled directly into firmware across a very wide range of microcontroller-based devices. NVD's description states: "Mbed TLS before 3.6.4 has a NULL pointer dereference because mbedtls_asn1_store_named_data can trigger conflicting data with val.p of NULL but val.len greater than zero" (NVD).

NVD's own Primary analysis scores this CVSS v3.1 7.5 (high), vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H — network-reachable, low attack complexity, no privileges or user interaction, high impact to availability only (NVD).

Mbed TLS's own security advisory gives the precise mechanics: "In some circumstances... mbedtls_asn1_store_named_data() leaves its output list with an item in an inconsistent state with val.p == NULL but val.len > 0. In that case, future uses of the list... are likely to dereference val.p, a NULL pointer." The advisory explains the trigger occurs when an item with a given OID is already in the list and the function is called again for the same OID with val_len = 0: it frees val.p as documented but fails to update val.len, so a subsequent call with the same OID (and a length not greater than the last non-zero length) causes the NULL dereference. The same root cause is reachable through attacker-controlled input via mbedtls_x509_string_to_names() and the certificate/CSR writer functions mbedtls_x509write_crt_set_subject_name(), mbedtls_x509write_crt_set_issuer_name() and mbedtls_x509write_csr_set_subject_name(), when the input string "contain[s] at least two entries with the same type: one with a non-zero length, and a subsequent one of length zero" — for example a name string like "DC=foo,DC=#0000,DC=bar". Mbed TLS rates the issue Medium severity and states the impact is "NULL pointer dereference, leading to DoS on platforms with memory protection, and possibly code execution on microcontrollers without an MMU or MPU," crediting researchers Linh Le and Ngan Nguyen from Calif with the find; the fix shipped in Mbed TLS 3.6.4 (Mbed TLS security advisory).

Debian's LTS security team confirmed the same issue and shipped a fix for Debian 11 (bullseye) in mbedtls 2.16.9-0.1+deb11u2, grouping it with three related CVEs (CVE-2025-47917, CVE-2025-52496, CVE-2025-52497) fixed in the same update: "The handling of val.p and val.len in mbedtls_asn1_store_named_data was inconsistent and allowed NULL pointer dereference. The fix for this issue depended on fixes for two related issues in the same piece of code, which are now also fixed" (Debian LTS announce DLA-4274-1).

This CVE is not listed in the CISA Known Exploited Vulnerabilities catalog as of catalog version 2026.11.06, and FIRST scores the probability of exploitation at 0.00574 (47.593rd percentile) as of 2026-11-06 (CISA KEV, FIRST EPSS).

Mbed TLS's own advisory notes that applications which only use, but never create, certificates or CSRs — and applications that call the affected functions only with trusted input — are not affected; firmware that parses untrusted certificate- or CSR-subject strings while generating certificates should be rebuilt against Mbed TLS 3.6.4 or later.

How to fix this class of issueThis advisory's weakness class is Memory corruption. Our practical guide covers how to detect, fix, verify and disclose it: How to fix memory corruption in embedded firmware.

Evidence

  • Mbed TLS before 3.6.4 has a NULL pointer dereference because mbedtls_asn1_store_named_data can trigger conflicting data with val.p of NULL but val.len greater than zero. — NVD
  • NVD's own Primary analysis scores this CVSS v3.1 7.5 (high), vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H. — NVD
  • Mbed TLS's own advisory explains the val.p/val.len inconsistency, how it is reachable via mbedtls_x509_string_to_names() and the certificate/CSR writer functions with input like "DC=foo,DC=#0000,DC=bar", rates it Medium severity with impact up to possible code execution on MMU/MPU-less microcontrollers, and records the fix in Mbed TLS 3.6.4. — Mbed TLS security advisory
  • Debian's LTS security team fixed the same issue for Debian 11 (bullseye) in mbedtls 2.16.9-0.1+deb11u2, alongside three related CVEs. — Debian LTS announce DLA-4274-1
  • Not present in the CISA KEV catalog as of catalog version 2026.11.06; EPSS score is 0.00574 (47.593rd percentile) as of 2026-11-06. — FIRST EPSS

Related advisories

Sources

  1. NVD
  2. Mbed TLS security advisory
  3. Debian LTS announce DLA-4274-1
  4. CISA KEV
  5. FIRST EPSS

Frequently asked questions

Why does NVD rate CVE-2025-48965 high (7.5) while Mbed TLS's own advisory calls it Medium severity?

NVD's Primary CVSS v3.1 score of 7.5 reflects a network-reachable, unauthenticated, high-availability-impact vector; Mbed TLS's advisory reaches a lower Medium rating but still warns the impact ranges from a DoS crash up to possible code execution on microcontrollers without an MMU or MPU, so the practical risk depends heavily on the target platform.

Can CVE-2025-48965 be triggered just by validating a certificate, without creating one?

No. Mbed TLS's advisory states that applications which only use, but do not create, certificates or CSRs are not affected, since the bug lives in the functions that build subject/issuer name lists, such as mbedtls_x509_string_to_names() and the certificate/CSR-writer functions.

What input triggers the NULL pointer dereference in CVE-2025-48965?

Mbed TLS's advisory gives the example input string "DC=foo,DC=#0000,DC=bar" — a name string with two entries of the same OID type where one has a non-zero length and a following one has length zero, which corrupts the internal named-data list and causes a NULL pointer dereference during string parsing.