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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine:v3.20 | curl | 8.9.0-r0 | ALPINE-CVE-2024-6197 |
| Alpine:v3.21 | curl | 8.9.0-r0 | ALPINE-CVE-2024-6197 |
| Alpine:v3.22 | curl | 8.9.0-r0 | ALPINE-CVE-2024-6197 |
| Alpine:v3.23 | curl | 8.9.0-r0 | ALPINE-CVE-2024-6197 |
| Alpine:v3.24 | curl | 8.9.0-r0 | ALPINE-CVE-2024-6197 |
| Debian:13 | curl | 8.9.0-1 | DEBIAN-CVE-2024-6197 |
| Debian:14 | curl | 8.9.0-1 | DEBIAN-CVE-2024-6197 |
| Ubuntu:22.04:LTS | curl | 7.81.0-1ubuntu1.16 | UBUNTU-CVE-2024-6197 |
| Ubuntu:24.04:LTS | curl | 8.5.0-2ubuntu10.1 | UBUNTU-CVE-2024-6197 |