Cloudanix VulnDB

CVE-2024-45158

Critical · 9.8

CVSS

9.8

EPSS

0.7%

Published

Sep 5, 2024

CISA due date

—

Cloudanix analysis

Next patch cycle SSVC: Track

A cryptography library flaw could let attackers seize control of or shut down affected systems if certain functions receive unexpected data.

Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
Low
Impact
Remote Code Execution
Component
Library
Class
Buffer Overflow
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

A stack buffer overflow occurs in mbedtls_ecdsa_der_to_raw() and mbedtls_ecdsa_raw_to_der() when the bits parameter exceeds the largest supported curve size, leading to memory corruption in configurations with PSA disabled where applications invoke these functions directly.

Why it matters to the business

Successful exploitation can result in remote code execution or denial of service, enabling attackers to compromise systems, exfiltrate data, or disrupt operations in environments relying on the vulnerable cryptography library.

How an attack unfolds

An attacker identifies an application that directly calls the affected functions, supplies crafted ECDSA data with an oversized bits parameter to trigger the overflow, and leverages the corruption to execute arbitrary code or crash the process.

How to fix it

Upgrade Mbed TLS to 3.6.1 or later. For mysql-client (Bitnami) update to version 10.4.25.

How to confirm the fix worked

Confirm the installed Mbed TLS version is at least 3.6.1, review application code for direct calls to the functions, and test with oversized bits parameters to ensure no overflow occurs.

Typical attack path

  1. Scan for applications exposing or using direct calls to mbedtls_ecdsa_der_to_raw or mbedtls_ecdsa_raw_to_der
  2. Craft malicious input containing an ECDSA structure with bits larger than supported curves
  3. Deliver the input to the target application to trigger the stack overflow
  4. Exploit memory corruption for code execution or service disruption

How to detect it

Monitor application logs and crash reports for errors related to ECDSA conversion functions or unexpected terminations when processing certificate or signature data; review process dumps for signs of stack corruption.

What your security team should do

  • Immediately update all affected packages to the fixed versions listed
  • Audit source code for any direct invocations of the vulnerable functions
  • Implement input validation around ECDSA parameter handling in custom applications

The record

An issue was discovered in Mbed TLS 3.6 before 3.6.1. A stack buffer overflow in mbedtls_ecdsa_der_to_raw() and mbedtls_ecdsa_raw_to_der() can occur when the bits parameter is larger than the largest supported curve. In some configurations with PSA disabled, all values of bits are affected. (This never happens in internal library calls, but can affect applications that call these functions directly.)

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