Critical severity · published Jul 20, 2025
CVE-2025-47917
Mbed TLS before 3.6.4 allows a use-after-free in certain situations of applications that are developed in accordance with the documentation
9.8
CVSS
2.4%
EPSS
No
On KEV
Description
Mbed TLS before 3.6.4 allows a use-after-free in certain situations of applications that are developed in accordance with the documentation. The function mbedtls_x509_string_to_names() takes a head argument that is documented as an output argument. The documentation does not suggest that the function will free that pointer; however, the function does call mbedtls_asn1_free_named_data_list() on that argument, which performs a deep free(). As a result, application code that uses this function (relying only on documented behavior) is likely to still hold pointers to the memory blocks that were freed, resulting in a high risk of use-after-free or double-free. In particular, the two sample programs x509/cert_write and x509/cert_req are affected (use-after-free if the san string contains more than one DN).
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Confidentiality
High
Integrity
High
Availability
High
Scope
Unchanged
Exploitation
Is it being used?
Exploit prediction (EPSS)2.4% · higher than 84% of CVEs
Exploited in the wildNo evidence yet
CISA KEVNot listed
Ransomware campaign useNot known
Affected products
Which versions
MB
mbedtls · Mbed
before 3.6.4 · source: vendor
MT
Mbed Tls · Arm
before 3.6.4 · source: NVD
References
NVD
https://nvd.nist.gov/vuln/detail/CVE-2025-47917
CVE.org
https://www.cve.org/CVERecord?id=CVE-2025-47917
Mitigation
https://github.com/Mbed-TLS/mbedtls-docs/blob/main/security-advisories/mbedtls-security-advisory-2025-06-7.md
Vendor Advisory
https://mbed-tls.readthedocs.io/en/latest/tech-updates/security-advisories/
lists.debian.org
https://lists.debian.org/debian-lts-announce/2025/08/msg00013.html
lists.debian.org
https://lists.debian.org/debian-lts-announce/2025/08/msg00025.html
More from mbedtls
9.8
CVE-2024-49195
Mbed TLS 3.5.x through 3.6.x before 3.6.2 has a buffer underrun in pkwrite when writing an opaque key pair
9.8
CVE-2024-45158
An issue was discovered in Mbed TLS 3.6 before 3.6.1
8.2
CVE-2024-28960
An issue was discovered in Mbed TLS 2.18.0 through 2.28.x before 2.28.8 and 3.x before 3.6.0, and Mbed Crypto
7.8
CVE-2025-52496
Mbed TLS before 3.6.4 has a race condition in AESNI detection if certain compiler optimizations occur
7.5
CVE-2025-48965
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
