The Most Dangerous Code in the World: Validating SSL Certificates In

The Most Dangerous Code in the World: Validating SSL Certificates In

The Most Dangerous Code in the World: Validating SSL Certificates in Non-Browser Software Martin Georgiev Subodh Iyengar Suman Jana The University of Texas Stanford University The University of Texas at Austin at Austin Rishita Anubhai Dan Boneh Vitaly Shmatikov Stanford University Stanford University The University of Texas at Austin ABSTRACT cations. The main purpose of SSL is to provide end-to-end security SSL (Secure Sockets Layer) is the de facto standard for secure In- against an active, man-in-the-middle attacker. Even if the network ternet communications. Security of SSL connections against an is completely compromised—DNS is poisoned, access points and active network attacker depends on correctly validating public-key routers are controlled by the adversary, etc.—SSL is intended to certificates presented when the connection is established. guarantee confidentiality, authenticity, and integrity for communi- We demonstrate that SSL certificate validation is completely bro- cations between the client and the server. Authenticating the server is a critical part of SSL connection es- ken in many security-critical applications and libraries. Vulnerable 1 software includes Amazon’s EC2 Java library and all cloud clients tablishment. This authentication takes place during the SSL hand- based on it; Amazon’s and PayPal’s merchant SDKs responsible shake, when the server presents its public-key certificate. In order for transmitting payment details from e-commerce sites to payment for the SSL connection to be secure, the client must carefully verify gateways; integrated shopping carts such as osCommerce, ZenCart, that the certificate has been issued by a valid certificate authority, Ubercart, and PrestaShop; AdMob code used by mobile websites; has not expired (or been revoked), the name(s) listed in the certifi- Chase mobile banking and several other Android apps and libraries; cate match(es) the name of the domain that the client is connecting Java Web-services middleware—including Apache Axis, Axis 2, to, and perform several other checks [14, 15]. Codehaus XFire, and Pusher library for Android—and all applica- SSL implementations in Web browsers are constantly evolving tions employing this middleware. Any SSL connection from any of through “penetrate-and-patch” testing, and many SSL-related vul- these programs is insecure against a man-in-the-middle attack. nerabilities in browsers have been repaired over the years. SSL, The root causes of these vulnerabilities are badly designed APIs however, is also widely used in non-browser software whenever of SSL implementations (such as JSSE, OpenSSL, and GnuTLS) secure Internet connections are needed. For example, SSL is used and data-transport libraries (such as cURL) which present devel- for (1) remotely administering cloud-based virtual infrastructure opers with a confusing array of settings and options. We analyze and sending local data to cloud-based storage, (2) transmitting cus- perils and pitfalls of SSL certificate validation in software based on tomers’ payment details from e-commerce servers to payment pro- these APIs and present our recommendations. cessors such as PayPal and Amazon, (3) logging instant messenger clients into online services, and (4) authenticating servers to mobile applications on Android and iOS. Categories and Subject Descriptors These programs usually do not implement SSL themselves. In- C.2.0 [Computer-Communication Networks]: General—Secu- stead, they rely on SSL libraries such as OpenSSL, GnuTLS, JSSE, rity and protection; K.4.4 [Computers and Society]: Electronic CryptoAPI, etc., as well as higher-level data-transport libraries, Commerce—Security such as cURL, Apache HttpClient, and urllib, that act as wrappers around SSL libraries. In software based on Web services, there is Keywords an additional layer of abstraction introduced by Web-services mid- dleware such as Apache Axis, Axis 2, or Codehaus XFire. SSL, TLS, HTTPS, public-key infrastructure, public-key certifi- cates, security vulnerabilities Our contributions. We present an in-depth study of SSL connec- tion authentication in non-browser software, focusing on how di- 1. INTRODUCTION verse applications and libraries on Linux, Windows, Android, and iOS validate SSL server certificates. We use both white- and black- Originally deployed in Web browsers, SSL (Secure Sockets Lay- box techniques to discover vulnerabilities in validation logic. Our er) has become the de facto standard for secure Internet communi- main conclusion is that SSL certificate validation is completely bro- ken in many critical software applications and libraries. When presented with self-signed and third-party certificates—including Permission to make digital or hard copies of all or part of this work for a certificate issued by a legitimate authority to a domain called personal or classroom use is granted without fee provided that copies are AllYourSSLAreBelongTo.us —they establish SSL connec- not made or distributed for profit or commercial advantage and that copies tions and send their secrets to a man-in-the-middle attacker. bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. 1 CCS’12, October 16–18, 2012, Raleigh, North Carolina, USA. SSL also supports client authentication, but we do not analyze it Copyright 2012 ACM 978-1-4503-1651-4/12/10 ...$15.00. in this paper. This is exactly the attack that SSL is intended to protect against. In summary, SSL connections established by any of the above It does not involve compromised or malicious certificate authori- programs are insecure against a man-in-the-middle attack. All ties, nor forged certificates, nor compromised private keys of legit- vulnerabilities have been empirically confirmed. imate servers. The only class of vulnerabilities we exploit are logic Causes. For the most part, the actual SSL libraries used in these errors in client-side SSL certificate validation. programs are correct. Yet, regardless of which well-known library The root cause of most of these vulnerabilities is the terrible de- the software relies on—whether JSSE, OpenSSL, GnuTLS, or Cryp- sign of the APIs to the underlying SSL libraries. Instead of ex- toAPI, used directly or wrapped into a data-transport library such pressing high-level security properties of network tunnels such as as Apache HttpClient or cURL—it often finds a way to end up with confidentiality and authentication, these APIs expose low-level de- broken or disabled SSL certificate validation. tails of the SSL protocol to application developers. As a conse- The primary cause of these vulnerabilities is the developers’ mis- quence, developers often use SSL APIs incorrectly, misinterpreting understanding of the numerous options, parameters, and return val- and misunderstanding their manifold parameters, options, side ef- ues of SSL libraries. For example, Amazon’s Flexible Payments fects, and return values. In several cases, we observed developers Service PHP library attempts to enable hostname verification by introducing new vulnerabilities when attempting to “fix” certificate setting cURL’s CURLOPT_SSL_VERIFYHOST parameter to true. Un- validation bugs. Furthermore, deveopers often do not understand fortunately, the correct, default value of this parameter is 2; setting which security properties are or are not provided by a given SSL it to true silently changes it to 1 and disables certificate validation. implementation: for example, they use SSL libraries that do not PayPal Payments Standard PHP library introduced the same bug validate certificates even when security is essential (e.g., connect- when updating a previous, broken implementation. Another ex- ing to a payment processor). More prosaic, yet deadly causes in- ample is Lynx, a text-based browser which is often used program- clude intermediate layers of the software stack silently disabling matically and thus included in our study. It checks for self-signed certificate validation and developers turning off certificate valida- certificates—but only if GnuTLS’s certificate validation function tion accidentally (e.g., for testing) or intentionally. returns a negative value. Unfortunately, this function returns 0 for certain errors, including certificates signed by an untrusted author- 2. OVERVIEW OF OUR RESULTS ity. Chain-of-trust verification in Lynx is thus broken. Our study uncovered a wide variety of SSL certificate valida- Developers often misunderstand security guarantees provided by tion bugs. Affected programs include those responsible for manag- SSL libraries. For example, JSSE (Java Secure Socket Extension) ing cloud-based storage and computation, such as Amazon’s EC2 has multiple interfaces for managing SSL connections. The “ad- Java client library and Elastic Load Balancing API Tools, Apache vanced” SSLSocketFactory API silently skips hostname verifica- Libcloud, Rackspace iOS client, and Windows-based cloud storage tion if the algorithm field in the SSL client is NULL or an empty clients such as ElephantDrive and FilesAnywhere. string rather than HTTPS. This is mentioned in passing in the JSSE Java-based Web-services middleware, such as Apache Axis, Axis reference guide, yet many Java implementations of SSL-based pro- 2, and Codehaus XFire, is broken, too. So is the Android library tocols use SSLSocketFactory without performing their own host- for Pusher notification API and Apache ActiveMQ implementation name verification. Vulnerable libraries include Apache

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    12 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us