CVE-2024-45159
Critical · 9.8CVSS
9.8
EPSS
0.4%
Published
Sep 5, 2024
CISA due date
—
Cloudanix analysis
A flaw in a widely used security library could let attackers use the wrong kind of digital certificate to log in to servers, potentially allowing unauthorized access.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Library
- Class
- Authentication Bypass
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Incorrect clearing of MBEDTLS_X509_BADCERT_KEY_USAGE and MBEDTLS_X509_BADCERT_EXT_KEY_USAGE bits in mbedtls_ssl_get_verify_result() for TLS 1.3 optional client authentication allows certificates lacking proper keyUsage or extKeyUsage to be treated as valid for client auth.
Why it matters to the business
Attackers may gain unauthorized access to services that rely on TLS client certificate authentication, potentially exposing sensitive data or systems, though low exploit maturity and EPSS reduce immediate widespread risk.
How an attack unfolds
An attacker obtains a certificate valid for non-TLS purposes, connects to a vulnerable TLS 1.3 server configured for optional client authentication, presents the certificate during the handshake, and the flawed verification allows the connection to proceed as authenticated.
How to fix it
Upgrade Mbed TLS to version 3.6.1 or apply commit 71c569d44bf3a8bd53d874c81ee8ac644dd6e9e3; update affected mysql-client (Bitnami) packages to version 10.3.35 or later.
How to confirm the fix worked
Confirm deployed version is 3.6.1 or newer, then test handshake behavior using a certificate with non-client-auth keyUsage to verify MBEDTLS_X509_BADCERT_KEY_USAGE is now correctly reported.
Typical attack path
- Acquire a certificate whose keyUsage or extKeyUsage does not permit TLS client authentication
- Initiate a TLS 1.3 handshake against a server with optional client authentication enabled
- Supply the certificate in the ClientCertificate message
- Bypass intended authorization checks due to incorrect verify result
- Proceed with authenticated session to access protected resources
How to detect it
Review TLS handshake logs for successful client authentications that used certificates later found to lack proper keyUsage values; correlate with certificate issuance records.
What your security team should do
- Apply the listed fixed versions immediately on all TLS 1.3 servers using optional client authentication
- Audit configurations to disable optional client auth where possible until patched
- Monitor for certificate-related authentication anomalies in application logs
The record
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).
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Alpine:v3.20 | mbedtls | 0 | 3.6.1-r0 |
| Alpine:v3.21 | mbedtls | 0 | 3.6.1-r0 |
| Alpine:v3.22 | mbedtls | 0 | 3.6.1-r0 |
| Ubuntu:20.04:LTS | mbedtls | 0 | No fix |
| Ubuntu:22.04:LTS | mbedtls | 0 | No fix |
| Ubuntu:24.04:LTS | mbedtls | 0 | No fix |
| Ubuntu:24.10 | mbedtls | 0 | No fix |
| Ubuntu:25.04 | mbedtls | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | mbedtls | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | mbedtls | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | mbedtls | 0 | No fix |
Related vulnerabilities
- JLSEC-2025-187 Mbed TLS before 2.28.10 and 3.x before 3.6.3, in some cases of failed memory allocation… Also affects mbedtls
- CVE-2024-49195 Mbed TLS 3.5.x through 3.6.x before 3.6.2 has a buffer underrun in pkwrite when writing… Also affects mbedtls
- CVE-2024-45158 An issue was discovered in Mbed TLS 3.6 before 3.6.1. Also affects mbedtls
- CVE-2024-45157 An issue was discovered in Mbed TLS before 2.28.9 and 3.x before 3.6.1, in which the… Also affects mbedtls
- CVE-2024-28960 An issue was discovered in Mbed TLS 2.18.0 through 2.28.x before 2.28.8 and 3.x before… Also affects mbedtls
- CVE-2024-23775 Integer Overflow vulnerability in Mbed TLS 2.x before 2.28.7 and 3.x before 3.5.2, allows… Also affects mbedtls
- CVE-2024-23170 An issue was discovered in Mbed TLS 2.x before 2.28.7 and 3.x before 3.5.2. Also affects mbedtls
- CVE-2023-43615 Mbed TLS 2.x before 2.28.5 and 3.x before 3.5.0 has a Buffer Overflow. Also affects mbedtls