REDHAT-BUG-2299653: Medium severity curl libcurl vulnerability
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 Software
Event History
Frequently Asked Questions
What must an attacker be able to provide to trigger the flaw?
The attacker needs to cause libcurl's ASN.1 parser to process an invalid ASN.1 UTF-8 string field, so that utf8asn1str() takes its error path.
How does the memory allocator affect the outcome?
Most modern malloc implementations detect the invalid free of a local stack buffer and immediately abort, making a crash the likely result. Implementations that accept the pointer may add stack memory to their available chunks, allowing nearby stack memory to be overwritten.
Is code execution ruled out?
No. The expected outcome is a crash, but more serious impact cannot be ruled out under special circumstances because the overwrite may involve memory pointers and flags selected by the free() implementation.