Every CVE Search/ Get API key

CVE-2025-47917

Mbed TLS before 3.6.4 allows a use-after-free in certain situations of applications that are...

8.9 HighPublic exploitFix available

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

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
High
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
Low
Integrity
High
Availability
High

Exploit likelihood

2.44%Up 2.4 points since Jul 21, 2025
90%50%10%1%

What each source reports

CVE List Score used 8.9

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

Record
CVE-2025-47917
CVSS 3.1
8.9 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:H/A:H
Weakness
CWE-416
Updated
2026-11-02
EUVDEUVD-2025-22035 8.9

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

Record
EUVD-2025-22035
CVSS 3.1
8.9 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:H/A:H
Updated
2026-11-02
GitHub AdvisoriesGHSA-7xcg-xp2h-m42v 8.9

Mbed TLS before 3.6.4 allows a use-after-free in certain situations of applications that are...

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

Record
GHSA-7xcg-xp2h-m42v
CVSS 3.1
8.9 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:H/A:H
Weakness
CWE-416
Updated
2026-11-02
NVD 8.9

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

Record
CVE-2025-47917
CVSS 3.1
8.9 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:H/A:H
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-416
Updated
2026-11-02
OSVALPINE-CVE-2025-47917 9.8

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

Record
ALPINE-CVE-2025-47917
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-03
OSV 8.9

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

Record
CVE-2025-47917
CVSS 3.1
8.9 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:H/A:H
Weakness
CWE-416
Updated
2026-11-02
Show 6 moreShow less
OSVDEBIAN-CVE-2025-47917 9.8

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

Record
DEBIAN-CVE-2025-47917
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVJLSEC-2025-231 9.8

Mbed TLS before 3.6.4 allows a use-after-free in certain situations of applications that are...

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

Record
JLSEC-2025-231
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVROOT-OS-DEBIAN-12-CVE-2025-47917 9.8

CVE-2025-47917 in mbedtls - Patched by Root

Root has patched CVE-2025-47917 in the mbedtls package for Root:Debian:12. Multiple fixed versions available.

Record
ROOT-OS-DEBIAN-12-CVE-2025-47917
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVUBUNTU-CVE-2025-47917 8.9

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

Record
UBUNTU-CVE-2025-47917
CVSS 3.1
8.9 HighCVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:L/I:H/A:H
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVopenSUSE-SU-2026:21144-1 No score

Security update for mbedtls

This update for mbedtls fixes the following issues:

Changes in mbedtls:

  • Update to 3.6.6 (LTS maintenance update from 3.6.1); security fixes accumulated across the 3.6.2-3.6.6 releases:
    • CVE-2024-49195 (boo#1231708): buffer underrun in pkwrite when writing an opaque key pair
    • CVE-2025-27809 (boo#1240051): certificate verification accepted arbitrary hostnames
    • CVE-2025-27810 (boo#1240052): possible authentication bypass on failed memory allocation / hardware errors
    • CVE-2025-47917 (boo#1246783): misleading memory management in mbedtls_x509_string_to_names()
    • CVE-2025-48965 (boo#1246784): NULL pointer dereference after mbedtls_asn1_store_named_data()
    • CVE-2025-49087 (boo#1246973): timing side channel in PKCS#7 padding removal
    • CVE-2025-49600 (boo#1245808): unchecked return values in LMS verification allow signature bypass via fault injection
    • CVE-2025-49601 (boo#1245809): out-of-bounds read in mbedtls_lms_import_public_key()
    • CVE-2025-52496 (boo#1245810): race in AES-NI support detection can lead to AES key extraction or GCM forgery
    • CVE-2025-52497 (boo#1245811): one-byte heap underflow when parsing PEM-encrypted material
    • CVE-2025-54764 (boo#1252341): timing attacks in RSA operations
    • CVE-2025-59438 (boo#1252454): padding-oracle attack via timing of cipher error reporting
    • CVE-2026-25833: PSA RNG state duplicated across fork()
    • CVE-2026-25834: TLS 1.3 HelloRetryRequest man-in-the-middle session-resumption downgrade
    • CVE-2026-25835: RNG state duplicated when application/VM state is cloned
Record
openSUSE-SU-2026:21144-1
Updated
2026-11-02
OSVUSN-8123-1 No score

mbedtls vulnerabilities

It was discovered that Mbed TLS incorrectly handled memory allocation failures. A remote attacker could possibly use this issue to crash the program. This issue only affected Ubuntu 18.04 LTS and Ubuntu 20.04 LTS. (CVE-2021-44732)

Jonathan Winzig discovered that Mbed TLS incorrectly handled crafted inputs. A remote attacker could possibly use this issue to crash the program, resulting in a denial of service. This issue only affected Ubuntu 18.04 LTS, Ubuntu 20.04 LTS, Ubuntu 22.04 LTS. (CVE-2024-23775)

It was discovered that Mbed TLS incorrectly handled the TLS handshake. A remote attacker could possibly use this issue to break the security guarantees of the TLS handshake. (CVE-2025-27810)

Linh Le and Ngan Nguyen discovered that Mbed TLS incorrectly documented the behavior of a function. Application code relying on the documented behavior might be affected. A remote attacker could possibly use this issue to execute arbitrary code. (CVE-2025-47917)

Linh Le and Ngan Nguyen discovered that Mbed TLS incorrectly handled crafted input. A remote attacker could possibly use this issue to crash the program, resulting in a denial of service. (CVE-2025-48965)

It was discovered that Mbed TLS incorrectly handled a race condition. An attacker could possibly use this issue to extract AES keys. (CVE-2025-52496)

Linh Le and Ngan Nguyen discovered that Mbed TLS incorrectly handled certain invalid input. A remote attacker could possibly use this issue to crash the program, resulting in a denial of service. (CVE-2025-52497)

Record
USN-8123-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
mbedtls
Alpine:v3.20
before 3.6.4-r0
3.6.4-r0
mbedtls
Alpine:v3.21
before 3.6.4-r0
3.6.4-r0
mbedtls
Alpine:v3.22
before 3.6.4-r0
3.6.4-r0
mbedtls
Alpine:v3.23
before 3.6.4-r0
3.6.4-r0
mbedtls
Alpine:v3.24
before 3.6.4-r0
3.6.4-r0
mbedtls3
Alpine:v3.24
before 3.6.4-r0
3.6.4-r0
mbedtls
Debian:12
All versions, plus listed versions
2.28.3-12.28.4-12.28.5-12.28.6-12.28.7-1
Show 17 moreShow less
2.28.7-1.12.28.7-1.1~exp12.28.8-13.6.0-13.6.0-23.6.0-33.6.2-13.6.2-23.6.2-33.6.3-13.6.4-13.6.4-23.6.5-0.13.6.5-0.1~deb13u13.6.6-0.13.6.7-23.6.7-3
None known
mbedtls
Debian:13
before 3.6.4-1
3.6.4-1
mbedtls
Debian:14
before 3.6.4-1
3.6.4-1
mbedtls
Debian:11
before 2.16.9-0.1+deb11u2, plus listed versions
2.16.9-0.12.16.9-0.1+deb11u1
2.16.9-0.1+deb11u2
Show 11 moreShow less
Affected packages
PackageAffectedFixed
mbedtls
Debian:11
before 2.16.9-0.1+deb11u3, plus listed versions
2.16.9-0.12.16.9-0.1+deb11u12.16.9-0.1+deb11u2
2.16.9-0.1+deb11u3
MbedTLS_jll
Julia
before 2.28.1010+0
2.28.1010+0
mbedtls
Root:Debian:12
before 2.28.3-1.root.io.14
2.28.3-1.root.io.142.28.3-1.root.io.62.28.3-1.root.io.22.28.3-1.root.io.52.28.3-1.root.io.42.28.3-1.root.io.92.28.3-1.root.io.72.28.3-1.root.io.102.28.3-1.root.io.152.28.3-1.root.io.32.28.3-1.root.io.162.28.3-1.root.io.82.28.3-1.root.io.112.28.3-1.root.io.122.28.3-1.root.io.132.28.3-1.aikido.17
rootio-mbedtls
Root:Debian:12
before 2.28.3-1.root.io.14
2.28.3-1.root.io.142.28.3-1.root.io.62.28.3-1.root.io.22.28.3-1.root.io.52.28.3-1.root.io.42.28.3-1.root.io.92.28.3-1.root.io.72.28.3-1.root.io.102.28.3-1.root.io.152.28.3-1.root.io.32.28.3-1.root.io.162.28.3-1.root.io.82.28.3-1.root.io.112.28.3-1.root.io.122.28.3-1.root.io.132.28.3-1.aikido.17
mbedtls
Ubuntu:16.04:LTS
All versions, plus listed versions
2.1.2-12.2.0-12.2.1-12.2.1-22.2.1-2ubuntu0.12.2.1-2ubuntu0.22.2.1-2ubuntu0.3
None known
mbedtls
Ubuntu:Pro:18.04:LTS
before 2.8.0-1ubuntu0.1~esm1, plus listed versions
2.5.1-1ubuntu12.6.0-12.7.0-22.8.0-1
2.8.0-1ubuntu0.1~esm1
mbedtls
Ubuntu:Pro:20.04:LTS
before 2.16.4-1ubuntu2+esm1, plus listed versions
2.16.2-12.16.3-12.16.4-1ubuntu2
2.16.4-1ubuntu2+esm1
mbedtls
Ubuntu:Pro:22.04:LTS
before 2.28.0-1ubuntu0.1~esm1, plus listed versions
2.16.9-0.1ubuntu12.16.11-0.1ubuntu12.16.11-0.32.28.0-12.28.0-1build1
2.28.0-1ubuntu0.1~esm1
mbedtls
Ubuntu:Pro:24.04:LTS
before 2.28.8-1ubuntu0.1~esm1, plus listed versions
2.28.3-12.28.6-1ubuntu12.28.7-1ubuntu12.28.7-1.1ubuntu12.28.8-1
2.28.8-1ubuntu0.1~esm1
mbedtls
Ubuntu:25.10
All versions, plus listed versions
3.6.2-3ubuntu1
None known
mbedtls
openSUSE:Leap 16.0
before 3.6.6-bp160.1.1
3.6.6-bp160.1.1

Public exploits

Links only. Every CVE stores no exploit code.

Public exploits
SourceLinkDate
PoC in GitHubbyteReaper77/CVE-2025-479172025-07-22
Exploit-DBMbed TLS 3.6.4 - Use-After-Free2025-09-16

History

History
RecordedChangedSources
affected, exploitsOSV
first indexedCVE List, EUVD, Exploit-DB, GitHub Advisories, NVD, OSV, PoC in GitHub

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2025-47917 is a high vulnerability (CVSS 8.9) in Arm Mbed Tls, published July 20, 2025. Public exploit code exists. EPSS puts the chance of exploitation in the next 30 days at 2.44%, the 84th percentile. Fixed in mbedtls 3.6.4-r0.

References

Show 39 moreShow less
MoveEnter Open