CVE-2025-47917

8.9 HIGH

📋 TL;DR

Mbed TLS versions before 3.6.4 contain a use-after-free vulnerability in the mbedtls_x509_string_to_names() function. The function unexpectedly frees memory that application code continues to reference, potentially leading to memory corruption. Applications using this function according to documentation are affected, including the sample programs x509/cert_write and x509/cert_req.

💻 Affected Systems

Products:
  • Mbed TLS
Versions: All versions before 3.6.4
Operating Systems: All platforms running Mbed TLS
Default Config Vulnerable: ⚠️ Yes
Notes: Applications must use the mbedtls_x509_string_to_names() function to be vulnerable. The sample programs x509/cert_write and x509/cert_req are confirmed affected when processing SAN strings with multiple DNs.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Remote code execution leading to complete system compromise if exploit chains with other vulnerabilities

🟠

Likely Case

Application crashes, denial of service, or memory corruption leading to information disclosure

🟢

If Mitigated

Application instability or crashes without privilege escalation

🌐 Internet-Facing: HIGH
🏢 Internal Only: MEDIUM

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires the application to use the vulnerable function with specific input conditions. The vulnerability is in library code that applications must call.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 3.6.4

Vendor Advisory: https://github.com/Mbed-TLS/mbedtls-docs/blob/main/security-advisories/mbedtls-security-advisory-2025-06-7.md

Restart Required: Yes

Instructions:

1. Update Mbed TLS to version 3.6.4 or later. 2. Recompile all applications using Mbed TLS. 3. Restart affected services.

🔧 Temporary Workarounds

Avoid vulnerable function

all

Do not use mbedtls_x509_string_to_names() function in application code

Input validation

all

Validate SAN strings to avoid multiple DNs if using the vulnerable function

🧯 If You Can't Patch

  • Isolate affected systems from untrusted networks
  • Implement strict input validation for certificate processing functions

🔍 How to Verify

Check if Vulnerable:

Check Mbed TLS version with: mbedtls_version -v or examine library version in application

Check Version:

mbedtls_version -v

Verify Fix Applied:

Confirm Mbed TLS version is 3.6.4 or later and recompile applications

📡 Detection & Monitoring

Log Indicators:

  • Application crashes, segmentation faults, or abnormal termination in certificate processing

Network Indicators:

  • Unexpected certificate processing failures

SIEM Query:

search for process crashes with mbedtls or certificate-related applications

🔗 References

📤 Share & Export