cURL / Mailing Lists / curl-library / Single Mail

curl-library

[SECURITY ADVISORY] darwinssl certificate check bypass

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 8 Jan 2015 09:39:17 +0100 (CET)

libcurl/darwinssl certificate check bypass
==========================================

Project cURL Security Advisory, January 8th 2015 -
[Permalink](http://curl.haxx.se/docs/adv_20150108A.html)

VULNERABILITY
-------------

libcurl stores TLS Session IDs in its associated Session ID cache when it
connects to TLS servers. In subsequent connects it re-uses the entry in the
cache to resume the TLS connection faster than when doing a full TLS
handshake. The actual implementation for the Session ID caching varies
depending on the underlying TLS backend.

libcurl allows applications to switch off certificate verification in two
different ways - using CURLOPT_SSL_VERIFYHOST and CURLOPT_SSL_VERIFYPEER.

When an application connected to a TLS server with certificate verification
disabled, it would store the Session ID in the cache and if then a subsequent
connection was made against the same host and port number, it would re-use the
former session and thanks to the the re-used session from the cache, it would
skip the certificate check and wrongly accept any bad certificate that could
be presented.

The problem was that the "key" used for caching Session IDs didn't take the
ceritificate check status into account.

This problem is specific to libcurl built to use the DarwinSSL back-end for
TLS, so it can only affect Mac and iPhone based applications.

We are not aware of any exploit of this flaw.

DarwinSSL is also known as SecureTransport.

INFO

----
This flaw can also affect the curl command line tool if a similar operation
series is made with that.
The Common Vulnerabilities and Exposures (CVE) project has assigned the name
CVE-2014-8151 to this issue.
AFFECTED VERSIONS
-----------------
- Affected versions: from libcurl 7.31.0 to and including 7.39.0
- Not affected versions: libcurl < 7.31.0 or >= 7.40.0
libcurl is used by many applications, but not always advertised as such!
THE SOLUTION
------------
libcurl 7.40.0 makes sure that the certificate check status is used in the key
set for the Session ID and thus it cannot re-use IDs between checked and
unchecked TLS connections.
A patch for this problem is available at:
     http://curl.haxx.se/CVE-2014-8151.patch
RECOMMENDATIONS
---------------
We suggest you take one of the following actions immediately, in order of
preference:
A - Upgrade to curl and libcurl 7.40.0
B - Apply the patch and rebuild libcurl
C - Avoid disabling the server certificate checks when using TLS
TIME LINE
---------
It was first reported to the curl project on November 26 2014.
We contacted Apple Product Security on December 17. We contacted
distros_at_openwall on December 28.
libcurl 7.40.0 was released on January 8th 2015, coordinated with the
publication of this advisory.
CREDITS
-------
Reported by Marc Hesse at RethinkDB.
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 2015-01-08