Mbed TlsApplication · Trustedfirmware

CVE-2024-45159

CRITICAL · 9.8 CVSS v3.1 Published 2024-09-05
Fix available
A fix is available. Upgrade to 3.6.1 or later.
See remediation →
100/100
Remediation priority · Urgent
Remotely reachable No privileges Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
An issue was discovered in Mbed TLS 3.x before 3.6.1. With TLS 1.3, when a server enables optional authentication of the client, if the client-provided certificate does not have appropriate values in if keyUsage or extKeyUsage extensions, then the return value of mbedtls_ssl_get_verify_result() would incorrectly have the MBEDTLS_X509_BADCERT_KEY_USAGE and MBEDTLS_X509_BADCERT_KEY_USAGE bits clear. As a result, an attacker that had a certificate valid for uses other than TLS client authentication would nonetheless be able to use it for TLS client authentication. Only TLS 1.3 servers were affected, and only with optional authentication (with required authentication, the handshake would be aborted with a fatal alert).

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

In Mbed TLS 3.x before 3.6.1, TLS 1.3 servers with optional client authentication fail to properly set MBEDTLS_X509_BADCERT_KEY_USAGE and MBEDTLS_X509_BADCERT_EXTSKUSAGE flags when a client presents a certificate lacking appropriate keyUsage or extKeyUsage extensions. This allows attackers to bypass client certificate validation using certificates valid for non-TLS purposes.

MitigationUpgrade to Mbed TLS 3.6.1 or later. As a temporary workaround, ensure only certificates with explicit TLS client auth keyUsage are accepted until the library upgrade is applied.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
Mbed TlsApplication
Affected:>= 3.2.0, < 3.6.1

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify Mbed TLS library version
    Locate the mbedtls version header file or library binary and read its version information. Common locations include /usr/include/mbedtls/version.h or the library file itself. Look for MBEDTLS_VERSION_NUMBER or mbedtls_version.h
    Affected if Version is 3.2.0 or higher but lower than 3.6.1 (the library falls within the affected range)
  2. Confirm TLS 1.3 is enabled in build configuration
    Inspect the mbedtls config.h or the compiled configuration macros (MBEDTLS_TLS_VERSION_1_3_ENABLED or similar). Check if MBEDTLS_SSL_TLS_C and MBEDTLS_SSL_PROTO_TLS1_3_MEMBER are defined
    Affected if TLS 1.3 protocol support is compiled into the library
  3. Verify optional client authentication is configured
    Inspect the SSL context setup code or configuration. Look for mbedtls_ssl_config_defaults() calls and check if MBEDTLS_SSL_VERIFY_OPTIONAL is set versus MBEDTLS_SSL_VERIFY_REQUIRED in the client authentication settings
    Affected if Client certificate verification is set to MBEDTLS_SSL_VERIFY_OPTIONAL (allowing connections without a valid client cert)
  4. Inspect certificate validation logic for key usage checks
    Examine the code path handling MBEDTLS_X509_BADCERT_KEY_USAGE and MBEDTLS_X509_BADCERT_EXTSKUSAGE flag handling after mbedtls_x509_crt_verify() returns. Look for whether these specific flags are properly propagated when keyUsage or extKeyUsage extensions are missing or invalid
    Affected if The verification logic does not properly set or check MBEDTLS_X509_BADCERT_KEY_USAGE and MBEDTLS_X509_BADCERT_EXTSKUSAGE flags for TLS 1.3 with optional auth

A user is affected if running Mbed TLS 3.2.0-3.6.0 with TLS 1.3 enabled and optional client authentication configured, where certificates lacking proper keyUsage or extKeyUsage extensions may be accepted without the appropriate error flags being set.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 3.6.1 or later
Fixed in 3.6.1
Interim mitigation

Upgrade to Mbed TLS 3.6.1 or later. As a temporary workaround, ensure only certificates with explicit TLS client auth keyUsage are accepted until the library upgrade is applied.

Recommended fix High confidence

3.6.1

  1. 1. Identify all systems and applications using Mbed TLS library version 3.2.0 or later but earlier than 3.6.1
  2. 2. Plan and schedule maintenance window for the upgrade
  3. 3. Download or obtain Mbed TLS version 3.6.1 or later from the official repository or distribution channel
  4. 4. Rebuild and recompile all applications and services that link against the Mbed TLS library
  5. 5. Deploy the updated library and restart all affected services
  6. 6. Verify that TLS 1.3 client certificate validation is now working correctly with proper keyUsage and extKeyUsage checks
  7. 7. Monitor for any issues after deployment
Caveat Minor version upgrades in mbedtls may include API changes; review the changelog for any breaking changes before upgrading

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Mbed Tls Scoped from the published advisory
  • Consultation2.0 h
  • Implementation8.0 h
  • Testing6.0 h
  • Review / QA3.0 h
19.0 hours of engineering $3,280
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $5,248.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2024-45159 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2024-45159 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data