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).
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| Mbed | mbedtls | < 3.6.4 | 3.6.4 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | mbedtls | 3.6.4-1 | — |
| Debian 13 | mbedtls | 3.6.4-1 | — |
| Debian 12 | mbedtls | No fix yet | — |
| Debian 11 | mbedtls | 2.16.9-0.1+deb11u2 | DLA-4274-2, DLA-4274-1 |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 25.10 | mbedtls | No fix yet | — |
| Ubuntu 16.04 LTS | mbedtls | No fix yet | — |
Show 4 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Pro 24.04 LTS | mbedtls | 2.28.8-1ubuntu0.1~esm1 | USN-8123-1 |
| Ubuntu Pro 22.04 LTS | mbedtls | 2.28.0-1ubuntu0.1~esm1 | USN-8123-1 |
| Ubuntu Pro 20.04 LTS | mbedtls | 2.16.4-1ubuntu2+esm1 | USN-8123-1 |
| Ubuntu Pro 18.04 LTS | mbedtls | 2.8.0-1ubuntu0.1~esm1 | USN-8123-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Leap 16.0 | mbedtls | 3.6.6-bp160.1.1 | openSUSE-SU-2026:21144-1 |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.24 | mbedtls +1 | 3.6.4-r0 | — |
| Alpine v3.23 | mbedtls | 3.6.4-r0 | — |
| Alpine v3.22 | mbedtls | 3.6.4-r0 | — |
| Alpine v3.21 | mbedtls | 3.6.4-r0 | — |
| Alpine v3.20 | mbedtls | 3.6.4-r0 | — |
Public exploits
Exploit or proof-of-concept code for this vulnerability is publicly available, which lowers the bar for attackers. Treat it as a reason to patch sooner.
Exploit-DB 1
- Mbed TLS 3.6.4 - Use-After-Free EDB-52427 · local · Sep 16, 2025
GitHub 1 repository
-
byteReaper77/CVE-2025-47917 ★ 1 · Jul 22, 2025
PoC exploit for CVE-2025-47917: Use-After-Free in mbedTLS leading to remote code execution.
Sources: PoC-in-GitHub, Metasploit Framework, Exploit-DB — updated daily. Only links are listed; no exploit code is hosted here.
Advisories 4
- openSUSE-SU-2026:21144-1 Security update for mbedtls SUSE / openSUSE Security Updates · Jun 30, 2026
- USN-8123-1 mbedtls vulnerabilities Ubuntu Security Notices (USN) · Apr 27, 2026
- DLA-4274-1 mbedtls - security update Debian Security (DSA / DLA) · Mar 9, 2026
- DLA-4274-2 mbedtls - security update Debian Security (DSA / DLA) · Mar 9, 2026