FlawAtlas
Search the atlas
CVE-2018-0500 High

SMTP send heap buffer overflow

curl might overflow a heap based memory buffer when sending data over SMTP and using a reduced read buffer. When sending data over SMTP, curl allocates a separate "scratch area" on the heap to be able to escape the uploaded data properly if the uploaded data contains data that requires it. The size of this temporary scratch area was mistakenly made to be `2 * sizeof(download_buffer)` when it should have been made `2 * sizeof(upload_buffer)`. The upload and the download buffer sizes are identically sized by default (16KB) but since version 7.54.1, curl can resize the download buffer into a smaller buffer (as well as larger). If the download buffer size is set to a value smaller than 10923, the `Curl_smtp_escape_eob()` function might overflow the scratch buffer when sending contents of sufficient size and contents. The curl command line tool lowers the buffer size when `--limit-rate` is set to a value smaller than 16KB.

Exploit probability 6.4%
Published July 11, 2018
Required by Not available
Last source change May 27, 2026

02 / AFFECTED SOFTWARE

Affected packages

Unknown Unknown

9 explicit affected versions

Unknown Unknown

18 explicit affected versions

03 / CONNECTIONS

Connected vulnerabilities

04 / EVIDENCE

Source records

Open Source Vulnerabilities CVE-2018-0500

Curl_smtp_escape_eob in lib/smtp.c in curl 7.54.1 to and including curl 7.60.0 has a heap-based buffer overflow that might be exploitable by an attacker who can control the data that curl transmits over SMTP with certain settings (i.e., use of a nonstandard --limit-rate argument or CURLOPT_BUFFERSIZE value).

View original source
Open Source Vulnerabilities CURL-CVE-2018-0500

curl might overflow a heap based memory buffer when sending data over SMTP and using a reduced read buffer. When sending data over SMTP, curl allocates a separate "scratch area" on the heap to be able to escape the uploaded data properly if the uploaded data contains data that requires it. The size of this temporary scratch area was mistakenly made to be `2 * sizeof(download_buffer)` when it should have been made `2 * sizeof(upload_buffer)`. The upload and the download buffer sizes are identically sized by default (16KB) but since version 7.54.1, curl can resize the download buffer into a smaller buffer (as well as larger). If the download buffer size is set to a value smaller than 10923, the `Curl_smtp_escape_eob()` function might overflow the scratch buffer when sending contents of sufficient size and contents. The curl command line tool lowers the buffer size when `--limit-rate` is set to a value smaller than 16KB.

View original source

05 / REFERENCES

Further evidence