# CVE-2025-49087: Mbed TLS timing side-channel in block cipher decryption with PKCS#7 padding

Source: https://junglewise.ai/threats/cve-2025-49087-mbed-tls-timing-side-channel-in-block-cipher-decryption-with-pkcs  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2025-07-20. Updated: 2026-06-05  
License: CC BY 4.0 with a link back

CVE-2025-49087 · Severity: medium · CVSS 4 · Published 2025-07-20

Mbed TLS is a widely used open-source cryptographic library that helps devices communicate securely. A flaw in how the library handles encrypted data blocks could allow an attacker to gradually reveal the original, unencrypted information by measuring tiny differences in how long the system takes to process certain requests. This could lead to the exposure of sensitive data like passwords or private messages if the attacker can observe the system's response times.

## Quick answers

**Is CVE-2025-49087 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2025-49087 being exploited in the wild.

**How severe is CVE-2025-49087?** Medium severity, with a CVSS score of 4, published 20 July 2025.

**Which products and versions are affected?** TrustedFirmware Mbed TLS 3.6.1 through 3.6.3.

**Is there a fix for CVE-2025-49087?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is CVE-2025-49087 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2025-49087?** Check whether anything you run is named in the advisory. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

A timing side-channel vulnerability exists in Mbed TLS versions 3.6.1 through 3.6.3 during the removal of PKCS#7 padding for block ciphers. The root cause is a non-constant-time check where the decryption function exits early if the last byte of the plaintext is outside the valid range (0, BLOCKSIZE]. By acting as a decryption oracle and measuring these timing discrepancies, a remote attacker can recover the last byte of each plaintext block. If the attacker controls a portion of the plaintext, this can be extended to recover the entire plaintext. The issue is resolved in Mbed TLS 3.6.4.

## Affected products

- TrustedFirmware Mbed TLS 3.6.1 through 3.6.3

## Timeline

- 2025-06-30: advisory: Vendor security advisory released
- 2025-07-20: disclosed: CVE published to NVD

## References

- [https://github.com/Mbed-TLS/mbedtls-docs/blob/main/security-advisories/mbedtls-security-advisory-2025-06-5.md](https://github.com/Mbed-TLS/mbedtls-docs/blob/main/security-advisories/mbedtls-security-advisory-2025-06-5.md)
- [https://mbed-tls.readthedocs.io/en/latest/tech-updates/security-advisories/](https://mbed-tls.readthedocs.io/en/latest/tech-updates/security-advisories/)
