cURL / Mailing Lists / curl-library / Single Mail

curl-library

[SECURITY ADVISORY 1/4] libcurl wrong re-use of connections

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 26 Mar 2014 08:04:30 +0100 (CET)

                      libcurl wrong re-use of connections
                      ===================================

Project cURL Security Advisory, March 26th 2014
http://curl.haxx.se/docs/security.html

1. VULNERABILITY

   libcurl can in some circumstances re-use the wrong connection when asked to
   do transfers using other protocols than HTTP and FTP.

   libcurl features a pool of recent connections so that subsequent requests
   can re-use an existing connection to avoid overhead.

   When re-using a connection a range of criterion must first be met. Due to an
   error in the code, a transfer that was initiated by an application could
   wrongfully re-use an existing connection to the same server that was
   authenticated using different credentials. The existing logic basically only
   worked well enough for HTTP and FTP, while all other network protocols were
   silently, but erroneously, assumed to work like HTTP. Basically, protocols
   that use connection oriented authentication need a new connection when new
   credentials are used.

   Affected protocols include: SCP, SFTP, POP3(S), IMAP(S), SMTP(S) and
   LDAP(S).

   Applications can disable libcurl's re-use of connections and thus mitigate
   this problem, by using one of the following libcurl options to alter how
   connections are or aren't re-used: CURLOPT_FRESH_CONNECT,
   CURLOPT_MAXCONNECTS and CURLMOPT_MAX_HOST_CONNECTIONS (if using curl_multi
   API).

   (This problem is very similar to a problem previously reported to NTLM HTTP
   connections, named CVE-2014-0015)

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

2. AFFECTED VERSIONS

   This flaw has existed ever since libcurl started to support these other
   protocols, although the code has been restructured a few times over the
   years so the mistake has altered shape.

   Affected versions: from libcurl 7.10.6 to and including 7.35.0
   Not affected versions: libcurl before 7.10.6 and >= 7.36.0

   libcurl is used by many applications, but not always advertised as such!

3. THE SOLUTION

   libcurl 7.36.0 makes sure that connections are re-used more strictly.

   A patch for this problem is available at:

     http://curl.haxx.se/libcurl-bad-reuse.patch

4. RECOMMENDATIONS

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

   A - Upgrade to curl and libcurl 7.36.0

   B - Apply the patch and rebuild libcurl

5. TIME LINE

   It was reported to the curl project on February 15th 2014. We contacted
   distros_at_openwall on March 16 2014.

   libcurl 7.36.0 was released on March 26th 2014, coordinated with the
   publication of this advisory.

6. CREDITS

   Bug reported and patch written by Steve Holme.

   Thanks a lot!

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2014-03-26