Critical Timing Attack Vulnerability in Mbed TLS Package
Summary
CVE-2025-49087: In Mbed TLS 3.6.1 through 3.6.3 before 3.6.4, a timing discrepancy in block cipher padding removal allows an attacker to recover the plaintext when PKCS#7 padding mode is used. Affects mbedtls across 2 version ranges.
< 3.6.4-r0
>= 71c569d44bf3a8bd53d874c81ee8ac644dd6e9e3, < c765c831e5c2a0971410692f92f7a81d6ec65ec2
Fixed in 3.6.4-r0. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Mbed TLS is a widely used cryptographic library designed to facilitate secure communication in various applications. It provides essential cryptographic functions such as encryption, decryption, and secure socket layer (SSL) capabilities. The library is particularly valued for its lightweight design, making it suitable for embedded systems and IoT devices. However, versions 3.6.1 through 3.6.3 of Mbed TLS are vulnerable to a timing attack that can compromise data security when using PKCS#7 padding mode.
Vulnerability Detail
The vulnerability, identified as CVE-2025-49087, arises from a timing discrepancy during the block cipher padding removal process in Mbed TLS. This flaw allows an attacker to exploit the timing differences to recover the plaintext data, posing a significant risk to the confidentiality of sensitive information. The issue is particularly critical for applications relying on PKCS#7 padding mode, as it can lead to unauthorized data exposure and potential breaches.
How To Fix
Minimum fixed version
3.6.4-r0
This is the first release that contains the fix.
sudo apk add --upgrade mbedtls
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If immediate updating is not feasible, consider implementing additional security measures such as input validation and rate limiting to mitigate the risk of timing attacks. However, these are not substitutes for patching the vulnerability.
Conclusion
The timing attack vulnerability in Mbed TLS (CVE-2025-49087) poses a serious risk to applications using affected versions. It is crucial to update to version 3.6.4 or later to ensure the security of sensitive data. Users should also consider utilizing tools like Vulert to monitor for vulnerabilities in their software.
See every vulnerability recorded for mbedtls →
FAQ
CVE-2025-49087 is a vulnerability in Mbed TLS that allows attackers to recover plaintext data through timing discrepancies during block cipher padding removal.
Versions 3.6.1 through 3.6.3 of Mbed TLS are affected by this vulnerability.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
The vulnerability can lead to unauthorized access to sensitive data, compromising the confidentiality of information transmitted using Mbed TLS.
If an immediate update is not possible, implement additional security measures such as input validation and rate limiting to help mitigate the risks.
References
Related vulnerabilities
Recent vulnerabilities recorded for mbedtls.