Vulnerability · Published Jul 24, 2024 · Assigned by curl

CVE-2024-6197freeing stack buffer in utf8asn1str

High 7.5

In plain English

A high-severity security flaw in curl from curl. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 4.3% (higher than 91% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.

Severity (CVSS 3.1)7.5High
Exploit odds (30 days)4.3%top 8.8% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack toolingNoneno public tooling known

Official description

libcurl's ASN1 parser has this utf8asn1str() function used for parsing an ASN.1 UTF-8 string. Itcan detect an invalid field and return error. Unfortunately, when doing so it also invokes `free()` on a 4 byte localstack buffer. Most modern malloc implementations detect this error and immediately abort. Some however accept the input pointer and add that memory to its list of available chunks. This leads to the overwriting of nearby stack memory. The content of the overwrite is decided by the `free()` implementation; likely to be memory pointers and a set of flags. The most likely outcome of exploting this flaw is a crash, although it cannot be ruled out that more serious results can be had in special circumstances.

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Alpine:v3.20curl8.9.0-r0ALPINE-CVE-2024-6197
Alpine:v3.21curl8.9.0-r0ALPINE-CVE-2024-6197
Alpine:v3.22curl8.9.0-r0ALPINE-CVE-2024-6197
Alpine:v3.23curl8.9.0-r0ALPINE-CVE-2024-6197
Alpine:v3.24curl8.9.0-r0ALPINE-CVE-2024-6197
Debian:13curl8.9.0-1DEBIAN-CVE-2024-6197
Debian:14curl8.9.0-1DEBIAN-CVE-2024-6197
Ubuntu:22.04:LTScurl7.81.0-1ubuntu1.16UBUNTU-CVE-2024-6197
Ubuntu:24.04:LTScurl8.5.0-2ubuntu10.1UBUNTU-CVE-2024-6197

Affected products (as reported)

VendorProductVersions
curl curl 8.8.0 – through 8.8.08.7.1 – through 8.7.18.7.0 – through 8.7.08.6.0 – through 8.6.0

References