FlawAtlas
Search the atlas
CVE-2016-7167 Moderate

curl escape and unescape integer overflows

The four libcurl functions `curl_escape()`, `curl_easy_escape()`, `curl_unescape` and `curl_easy_unescape` perform string URL percent escaping and unescaping. They accept custom string length inputs in signed integer arguments. (The functions having names without "easy" being the deprecated versions of the others.) The provided string length arguments were not properly checked and due to arithmetic in the functions, passing in the length `0xffffffff` (2^32-1 or `UINT_MAX` or even -1) would end up causing an allocation of zero bytes of heap memory that curl would attempt to write gigabytes of data into. The use of 'int' for this input type in the API is of course unwise but has remained so in order to maintain the API over the years.

Exploit probability 11.7%
Published September 14, 2016
Required by Not available
Last source change May 19, 2026

02 / AFFECTED SOFTWARE

Affected packages

Unknown Unknown

138 explicit affected versions

Unknown Unknown

82 explicit affected versions

03 / CONNECTIONS

Connected vulnerabilities

04 / EVIDENCE

Source records

Open Source Vulnerabilities CVE-2016-7167

Multiple integer overflows in the (1) curl_escape, (2) curl_easy_escape, (3) curl_unescape, and (4) curl_easy_unescape functions in libcurl before 7.50.3 allow attackers to have unspecified impact via a string of length 0xffffffff, which triggers a heap-based buffer overflow.

View original source
Open Source Vulnerabilities CURL-CVE-2016-7167

The four libcurl functions `curl_escape()`, `curl_easy_escape()`, `curl_unescape` and `curl_easy_unescape` perform string URL percent escaping and unescaping. They accept custom string length inputs in signed integer arguments. (The functions having names without "easy" being the deprecated versions of the others.) The provided string length arguments were not properly checked and due to arithmetic in the functions, passing in the length `0xffffffff` (2^32-1 or `UINT_MAX` or even -1) would end up causing an allocation of zero bytes of heap memory that curl would attempt to write gigabytes of data into. The use of 'int' for this input type in the API is of course unwise but has remained so in order to maintain the API over the years.

View original source

05 / REFERENCES

Further evidence