FlawAtlas
Search the atlas
CVE-2016-8622 Moderate

URL unescape heap overflow via integer truncation

The URL percent-encoding decode function in libcurl is called `curl_easy_unescape`. Internally, even if this function would be made to allocate a destination buffer larger than 2GB, it would return that new length in a signed 32-bit integer variable, thus the length would get either truncated only or both truncated and turned negative. That could then lead to libcurl writing outside of its heap based buffer. This can be triggered by a user on a 64-bit system if the user can send in a custom (large) URL to a libcurl using program.

Exploit probability 4.7%
Published November 2, 2016
Required by Not available
Last source change May 27, 2026

02 / AFFECTED SOFTWARE

Affected packages

Unknown Unknown

139 explicit affected versions

Unknown Unknown

70 explicit affected versions

03 / CONNECTIONS

Connected vulnerabilities

04 / EVIDENCE

Source records

Open Source Vulnerabilities CVE-2016-8622

The URL percent-encoding decode function in libcurl before 7.51.0 is called `curl_easy_unescape`. Internally, even if this function would be made to allocate a unscape destination buffer larger than 2GB, it would return that new length in a signed 32 bit integer variable, thus the length would get either just truncated or both truncated and turned negative. That could then lead to libcurl writing outside of its heap based buffer.

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

The URL percent-encoding decode function in libcurl is called `curl_easy_unescape`. Internally, even if this function would be made to allocate a destination buffer larger than 2GB, it would return that new length in a signed 32-bit integer variable, thus the length would get either truncated only or both truncated and turned negative. That could then lead to libcurl writing outside of its heap based buffer. This can be triggered by a user on a 64-bit system if the user can send in a custom (large) URL to a libcurl using program.

View original source

05 / REFERENCES

Further evidence