CVE-2024-6197 freeing stack buffer in utf8asn1str

High 7.5 Published Updated

An attacker can trigger a stack buffer free error in libcurl's ASN1 parser, causing crashes or potential code execution via memory corruption.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2024-6197?

CVE-2024-6197 is a high-severity memory corruption vulnerability in Haxx Libcurl, published on 24 Jul 2024. An attacker can exploit it over the internet without logging in, with no action from the victim.

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.

Which versions are affected by CVE-2024-6197?

It affects 1 product.

Products include Haxx Libcurl.

How do I fix CVE-2024-6197?

Upgrade to a fixed version.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2024-6197 being exploited?

There is no known exploitation of CVE-2024-6197 in the wild and no public exploit code.

All Haxx Libcurl vulnerabilities

Sources

Also known as ALPINE-CVE-2024-6197, AZL-47023, AZL-47028, AZL-47049, BELL-CVE-2024-6197, CLEANSTART-2026-TJ58314 and 5 more.

Is CVE-2024-6197 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free