CVE-2025-47917 Details
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).
A use-after-free vulnerability has been identified in Mbed TLS versions prior to 3.6.4. The issue arises in applications that follow the documentation, specifically within the function 'mbedtls_x509_string_to_names()'. This function is supposed to treat the 'head' argument as an output pointer, but the documentation fails to mention that it will free the pointer's memory. The function inadvertently calls 'mbedtls_asn1_free_named_data_list()', which performs a deep free of the data. Consequently, application code that relies on the documented behavior may still reference the now-freed memory, leading to a high risk of use-after-free or double-free errors. The vulnerability is particularly present in the sample programs 'x509/cert_write' and 'x509/cert_req', where the 'san' string contains more than one DN.
Users can upgrade to Mbed TLS version 3.6.4 or later to address this vulnerability.
Metrics
CVSS 4.0 Severity and Vector Strings:
No CVSS 4.0 data is available for this CVE.
CVSS 3.x Severity and Vector Strings:
No data available for CVSS Version 2.0 on this CVE.
CISA-ADP
Assessed Jul 22, 2025References to Advisories, Solutions, and Tools
By selecting these links, you will be leaving this site. These are references gathered from the official CVE record and are not endorsed by Volerion.
Weakness Enumeration
| CWE-ID | CWE Name | Source |
|---|---|---|
| CWE-416 | Use After Free | [email protected] |
Affected Products
| Product | Versions |
|---|---|
| arm mbed tls | < 3.6.4 |
CPE
Remediation
| |
Change History
6 change records found show changes
| Date | Action | Recorded By |
|---|---|---|
| Jun 17, 2026 | CVE Modified | [email protected] |
| Jun 17, 2026 | CVE Modified | CISA-ADP |
| Nov 3, 2025 | CVE Modified | CVE |
| Nov 3, 2025 | CVE Modified | CVE |
| Aug 7, 2025 | Initial Analysis | [email protected] |
| Jul 20, 2025 | New CVE Received | [email protected] |