Skip to content
OpenAdvisories
High · 8.9 Public exploit CVE-2025-47917 EUVD-2025-22035GHSA-7xcg-xp2h-m42v

Mbed TLS before 3.6.4 allows a use-after-free in certain situations of applications that are developed in accordance with the documentation…

Published Jul 20, 2025 · Updated Nov 3, 2025 · Assigned by mitre

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

VendorProductAffectedFixed
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.

ReleasePackageFixed inAdvisory
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
ReleasePackageFixed inAdvisory
Ubuntu 25.10 mbedtls No fix yet —
Ubuntu 16.04 LTS mbedtls No fix yet —
Show 4 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
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
ReleasePackageFixed inAdvisory
openSUSE Leap 16.0 mbedtls 3.6.6-bp160.1.1 openSUSE-SU-2026:21144-1
ReleasePackageFixed inAdvisory
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.

Third-party code, not reviewed by us. Public PoCs are sometimes fake or contain malware. Read the code first and run it only in an isolated lab, against systems you are authorised to test.

Exploit-DB 1

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

References