Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Date: Wed, 29 Nov 2017 10:34:17 +0100 (CET)
From: Daniel Stenberg <>
To: curl security announcements -- curl users <>,,
        libcurl hacking <>,
Subject: [SECURITY ADVISORY] curl: NTLM buffer overflow via integer

NTLM buffer overflow via integer overflow

Project curl Security Advisory, November 29th 2017 -


libcurl contains a buffer overrun flaw in the NTLM authentication code.

The internal function `Curl_ntlm_core_mk_ntlmv2_hash` sums up the lengths of
the user name + password (= SUM) and multiplies the sum by two (= SIZE) to
figure out how large storage to allocate from the heap.

The SUM value is subsequently used to iterate over the input and generate
output into the storage buffer. On systems with a 32 bit `size_t`, the math to
calculate SIZE triggers an integer overflow when the combined lengths of the
user name and password is larger than 2GB (2^31 bytes). This integer overflow
usually causes a very small buffer to actually get allocated instead of the
intended very huge one, making the use of that buffer end up in a buffer

We are not aware of any exploit of this flaw.


This bug was introduced in commit
[be285cde3f5](, April 2006.

The Common Vulnerabilities and Exposures (CVE) project has assigned the name
CVE-2017-8816 to this issue.


This is only an issue on 32 bit systems. It also requires the user and
password fields to use more than 2GB of memory combined, which in itself
should be rare.

- Affected versions: libcurl 7.15.4 to and including 7.56.1
- Not affected versions: libcurl < 7.15.4 and >= 7.57.0

curl is used by many applications, but not always advertised as such.


In libcurl version 7.57.0, the integer overflow is avoided.

A [patch for CVE-2017-8816]( is


We suggest you take one of the following actions immediately, in order of

  A - Upgrade curl to version 7.57.0

  B - Apply the patch to your version and rebuild

  C - Put length restrictions on the user name and passwords you can pass to


It was reported to the curl project on November 6, 2017.  We contacted
distros@...nwall on November 21.

curl 7.57.10 was released on November 29 2017, coordinated with the
publication of this advisory.


Reported by Alex Nichols. Patch by Daniel Stenberg.

Thanks a lot!



Powered by blists - more mailing lists

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.