==================================================================== CERT-Renater Note d'Information No. 2018/VULN348 _____________________________________________________________________ DATE : 31/10/2018 HARDWARE PLATFORM(S): / OPERATING SYSTEM(S): Systems running libcurl versions prior to 7.62.0. ===================================================================== https://curl.haxx.se/docs/CVE-2018-16839.html https://curl.haxx.se/docs/CVE-2018-16840.html https://curl.haxx.se/docs/CVE-2018-16842.html _____________________________________________________________________ SASL password overflow via integer overflow =========================================== Project curl Security Advisory, October 31st 2018 - [Permalink](https://curl.haxx.se/docs/CVE-2018-16839.html) VULNERABILITY ------------- libcurl contains a buffer overrun in the SASL authentication code. The internal function `Curl_auth_create_plain_message` fails to correctly verify that the passed in lengths for name and password aren't too long, then calculates a buffer size to allocate. On systems with a 32 bit `size_t`, the math to calculate the buffer size triggers an integer overflow when the user name 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 very similar to [CVE-2017-14618](https://curl.haxx.se/docs/CVE-2018-14618.html).) We are not aware of any exploit of this flaw. INFO ---- The affected function can only be invoked when using POP3(S), IMAP(S) or SMTP(S). This bug was introduced in [commit c56f9797e7feb7c2dc](https://github.com/curl/curl/commit/c56f9797e7feb7c2dc), August 2013. The Common Vulnerabilities and Exposures (CVE) project has assigned the name CVE-2018-16839 to this issue. CWE-131: Incorrect Calculation of Buffer Size Severity: 3.2 (Low) AFFECTED VERSIONS ----------------- This issue is only present on 32 bit systems. It also requires the username field to use more than 2GB of memory, which should be rare. - Affected versions: libcurl 7.33.0 to and including 7.61.1 - Not affected versions: libcurl < 7.33.0 and >= 7.62.0 curl is used by many applications, but not always advertised as such. THE SOLUTION ------------ In libcurl version 7.62.0, the integer overflow is avoided. An error will be returned if a too long user name is attempted. A [patch for CVE-2018-16839](https://github.com/curl/curl/commit/f3a24d7916b9173c69a3e0ee790102993833d6c5) is available. RECOMMENDATIONS --------------- We suggest you take one of the following actions immediately, in order of preference: A - Upgrade curl to version 7.62.0 B - Apply the patch to your version and rebuild C - Put length restrictions on the username field you can pass to libcurl TIME LINE --------- It was reported to the curl project on September 6, 2018. We contacted distros@openwall on October 22. curl 7.62.0 was released on October 31 2018, coordinated with the publication of this advisory. CREDITS ------- Reported by Harry Sintonen. Patch by Daniel Stenberg. Thanks a lot! -- / daniel.haxx.se _____________________________________________________________________ use-after-free in handle close ============================== Project curl Security Advisory, October 31st 2018 - [Permalink](https://curl.haxx.se/docs/CVE-2018-16840.html) VULNERABILITY ------------- libcurl contains a heap use-after-free flaw in code related to closing an easy handle. When closing and cleaning up an "easy" handle in the `Curl_close()` function, the library code first frees a struct (without nulling the pointer) and might then subsequently erroneously write to a struct field within that already freed struct. We are not aware of any exploit of this flaw. INFO ---- This bug was introduced in [commit b46cfbc068](https://github.com/curl/curl/commit/b46cfbc068), February 2018. The Common Vulnerabilities and Exposures (CVE) project has assigned the name CVE-2018-16840 to this issue. CWE-416: Use After Free Severity: 2.3 (Low) AFFECTED VERSIONS ----------------- - Affected versions: libcurl 7.59.0 to and including 7.61.1 - Not affected versions: libcurl < 7.59.0 and >= 7.62.0 curl is used by many applications, but not always advertised as such. THE SOLUTION ------------ A [patch for CVE-2018-16840](https://github.com/curl/curl/commit/81d135d67155c5295b1033679c606165d4e28f3f) is available. RECOMMENDATIONS --------------- We suggest you take one of the following actions immediately, in order of preference: A - Upgrade curl to version 7.62.0 B - Apply the patch to your version and rebuild TIME LINE --------- It was reported to the curl project on October 14, 2018. We contacted distros@openwall on October 22. curl 7.62.0 was released on October 31 2018, coordinated with the publication of this advisory. CREDITS ------- Reported by Brian Carpenter, Geeknik Labs. Patch by Daniel Stenberg. Thanks a lot! -- / daniel.haxx.se _____________________________________________________________________ warning message out-of-buffer read ================================== Project curl Security Advisory, October 31st 2018 - [Permalink](https://curl.haxx.se/docs/CVE-2018-16842.html) VULNERABILITY ------------- curl contains a heap out of buffer read vulnerability. The command line tool has a generic function for displaying warning and informational messages to stderr for various situations. For example if an unknown command line argument is used, or passed to it in a "config" file. This display function formats the output to wrap at 80 columns. The wrap logic is however flawed, so if a single word in the message is itself longer than 80 bytes the buffer arithmetic calculates the remainder wrong and will end up reading behind the end of the buffer. This could lead to information disclosure or crash. This vulnerability could lead to a security issue if used in this or similar situations: 1. a server somewhere uses the curl command line to run something 2. if it fails, it shows stderr to the user 3. the server takes user input for parts of its command line input 4. user provides something overly long that triggers this crash 5. the stderr output may now contain user memory contents that wasn't meant to be available We are not aware of any exploit of this flaw. INFO ---- This flaw exists in the command line tool only, not in libcurl. This bug was introduced in [commit d9ca9154d1](https://github.com/curl/curl/commit/d9ca9154d1), August 2005. The Common Vulnerabilities and Exposures (CVE) project has assigned the name CVE-2018-16842 to this issue. CWE-125: Out-of-bounds Read Severity: 3.3 (Low) AFFECTED VERSIONS ----------------- - Affected versions: curl 7.14.1 to and including 7.61.1 - Not affected versions: curl < 7.14.1 and >= 7.62.0 curl is used by many applications, but not always advertised as such. THE SOLUTION ------------ A [patch for CVE-2018-16842](https://github.com/curl/curl/commit/d530e92f59ae9bb2d47066c3c460b25d2ffeb211) RECOMMENDATIONS --------------- We suggest you take one of the following actions immediately, in order of preference: A - Upgrade curl to version 7.62.0 B - Apply the patch to your version and rebuild TIME LINE --------- It was reported to the curl project on October 27, 2018. We contacted distros@openwall on October 28. curl 7.62.0 was released on October 31 2018, coordinated with the publication of this advisory. CREDITS ------- Reported by Brian Carpenter, Geeknik Labs. Patch by Daniel Stenberg. Thanks a lot! -- / daniel.haxx.se ========================================================= + CERT-RENATER | tel : 01-53-94-20-44 + + 23/25 Rue Daviel | fax : 01-53-94-20-41 + + 75013 Paris | email:cert@support.renater.fr + =========================================================