NTLM password overflow via integer overflow
libcurl contains a buffer overrun in the NTLM authentication code. The internal function `Curl_ntlm_core_mk_nt_hash` multiplies the `length` of the password by two (SUM) to figure out how large temporary storage area to allocate from the heap. The `length` value is then subsequently used to iterate over the password and generate output into the allocated storage buffer. On systems with a 32-bit `size_t`, the math to calculate SUM triggers an integer overflow when the password length exceeds 2GB (2^31 bytes). This integer overflow usually causes a tiny buffer to actually get allocated instead of the intended huge one, making the use of that buffer end up in a heap buffer overflow. (This bug is almost identical to [CVE-2017-8816](https://curl.se/docs/CVE-2017-8816.html).)
02 / AFFECTED SOFTWARE
Affected packages
155 explicit affected versions
170 explicit affected versions
03 / CONNECTIONS
Connected vulnerabilities
04 / EVIDENCE
Source records
curl before version 7.61.1 is vulnerable to a buffer overrun in the NTLM authentication code. The internal function Curl_ntlm_core_mk_nt_hash multiplies the length of the password by two (SUM) to figure out how large temporary storage area to allocate from the heap. The length value is then subsequently used to iterate over the password and generate output into the allocated storage buffer. On systems with a 32 bit size_t, the math to calculate SUM triggers an integer overflow when the password length exceeds 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 heap buffer overflow. (This bug is almost identical to CVE-2017-8816.)
libcurl contains a buffer overrun in the NTLM authentication code. The internal function `Curl_ntlm_core_mk_nt_hash` multiplies the `length` of the password by two (SUM) to figure out how large temporary storage area to allocate from the heap. The `length` value is then subsequently used to iterate over the password and generate output into the allocated storage buffer. On systems with a 32-bit `size_t`, the math to calculate SUM triggers an integer overflow when the password length exceeds 2GB (2^31 bytes). This integer overflow usually causes a tiny buffer to actually get allocated instead of the intended huge one, making the use of that buffer end up in a heap buffer overflow. (This bug is almost identical to [CVE-2017-8816](https://curl.se/docs/CVE-2017-8816.html).)
05 / REFERENCES
Further evidence
- http://www.securitytracker.com/id/1041605
- https://access.redhat.com/errata/RHSA-2018:3558
- https://access.redhat.com/errata/RHSA-2019:1880
- https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2018-14618
- https://cert-portal.siemens.com/productcert/pdf/ssa-436177.pdf
- https://curl.haxx.se/docs/CVE-2018-14618.html
- https://psirt.global.sonicwall.com/vuln-detail/SNWLID-2018-0014
- https://security.gentoo.org/glsa/201903-03
- https://usn.ubuntu.com/3765-1/
- https://usn.ubuntu.com/3765-2/
- https://www.debian.org/security/2018/dsa-4286