FlawAtlas
Search the atlas
CVE-2016-8617 Moderate

OOB write via unchecked multiplication

In libcurl's base64 encode function, the output buffer is allocated as follows without any checks on `insize`: malloc( insize * 4 / 3 + 4 ) On systems with 32-bit addresses in userspace (e.g. x86, ARM, x32), the multiplication in the expression wraps around if `insize` is at least 1GB of data. If this happens, an undersized output buffer is allocated, but the full result is written, thus causing the memory behind the output buffer to be overwritten. If a username is set directly via `CURLOPT_USERNAME` (or curl's `-u, --user` option), this vulnerability can be triggered. The name has to be at least 512MB big in a 32-bit system. Systems with 64-bit versions of the `size_t` type are not affected by this issue.

Exploit probability 0.6%
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

217 explicit affected versions

03 / CONNECTIONS

Connected vulnerabilities

04 / EVIDENCE

Source records

Open Source Vulnerabilities CVE-2016-8617

The base64 encode function in curl before version 7.51.0 is prone to a buffer being under allocated in 32bit systems if it receives at least 1Gb as input via `CURLOPT_USERNAME`.

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

In libcurl's base64 encode function, the output buffer is allocated as follows without any checks on `insize`: malloc( insize * 4 / 3 + 4 ) On systems with 32-bit addresses in userspace (e.g. x86, ARM, x32), the multiplication in the expression wraps around if `insize` is at least 1GB of data. If this happens, an undersized output buffer is allocated, but the full result is written, thus causing the memory behind the output buffer to be overwritten. If a username is set directly via `CURLOPT_USERNAME` (or curl's `-u, --user` option), this vulnerability can be triggered. The name has to be at least 512MB big in a 32-bit system. Systems with 64-bit versions of the `size_t` type are not affected by this issue.

View original source

05 / REFERENCES

Further evidence