CVE-2025-47917
📋 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
- Mbed TLS
📦 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
🎯 Exploit Status
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
allDo not use mbedtls_x509_string_to_names() function in application code
Input validation
allValidate 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
- https://github.com/Mbed-TLS/mbedtls-docs/blob/main/security-advisories/mbedtls-security-advisory-2025-06-7.md
- https://mbed-tls.readthedocs.io/en/latest/tech-updates/security-advisories/
- https://lists.debian.org/debian-lts-announce/2025/08/msg00013.html
- https://lists.debian.org/debian-lts-announce/2025/08/msg00025.html