Off-by-one Error Affecting mbedtls package, versions [,3.6.4)


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.06% (18th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-CONAN-MBEDTLS-10645570
  • published8 Jul 2025
  • disclosed4 Jul 2025
  • creditLinh Le, Ngan Nguyen

Introduced: 4 Jul 2025

NewCVE-2025-52497  (opens in a new tab)
CWE-193  (opens in a new tab)

How to fix?

Upgrade mbedtls to version 3.6.4 or higher.

Overview

Affected versions of this package are vulnerable to Off-by-one Error via the mbedtls_pem_read_buffer, mbedtls_pk_parse and mbedtls_pk_parse_keyfile() functions when processing untrusted PEM input. An attacker can cause a one-byte heap-based buffer underflow by supplying specially crafted PEM data.

Note:

Applications are only affected if they process untrusted PEM-encrypted material (that is, if they call one of the above functions with a non-NULL password argument and untrusted PEM input).

Applications built with MBEDTLS_PEM_C disabled are not affected.

CVSS Base Scores

version 4.0
version 3.1