TLS/SSL (Mis)Protecting our Connections Security



Similar documents
Security Protocols/Standards

SSL/TLS: The Ugly Truth

SSL BEST PRACTICES OVERVIEW

Real-Time Communication Security: SSL/TLS. Guevara Noubir CSU610

Secure Sockets Layer

Communication Systems 16 th lecture. Chair of Communication Systems Department of Applied Sciences University of Freiburg 2009

Is Your SSL Website and Mobile App Really Secure?

Communication Systems SSL

Network Security Essentials Chapter 5

Secure Sockets Layer (SSL) / Transport Layer Security (TLS)

Security Protocols HTTPS/ DNSSEC TLS. Internet (IPSEC) Network (802.1x) Application (HTTP,DNS) Transport (TCP/UDP) Transport (TCP/UDP) Internet (IP)

Three attacks in SSL protocol and their solutions

Implementation Vulnerabilities in SSL/TLS

Announcement. Final exam: Wed, June 9, 9:30-11:18 Scope: materials after RSA (but you need to know RSA) Open books, open notes. Calculators allowed.

Chapter 17. Transport-Level Security

Secure Socket Layer (SSL) and Transport Layer Security (TLS)

Information Security

Web Security Considerations

Security Engineering Part III Network Security. Security Protocols (I): SSL/TLS

Outline. Transport Layer Security (TLS) Security Protocols (bmevihim132)

Security. Contents. S Wireless Personal, Local, Metropolitan, and Wide Area Networks 1

Recent (2014) vulnerabilities in SSL implementations. Leiden University. The university to discover.

Transport Level Security

SSL and Browsers: The Pillars of Broken Security

POODLE. Yoshiaki Kasahara Kyushu University 2015/3/3 APAN 39th in Fukuoka 1

Secure Socket Layer. Carlo U. Nicola, SGI FHNW With extracts from publications of : William Stallings.

Vulnerabilità dei protocolli SSL/TLS

Chapter 7 Transport-Level Security

Authenticity of Public Keys

Overview of SSL. Outline. CSC/ECE 574 Computer and Network Security. Reminder: What Layer? Protocols. SSL Architecture

Secure Sockets Layer (SSL ) / Transport Layer Security (TLS) Network Security Products S31213

Overview. SSL Cryptography Overview CHAPTER 1

TLS/SSL in distributed systems. Eugen Babinciuc

Overview of CSS SSL. SSL Cryptography Overview CHAPTER

Public Key Infrastructure (PKI)

CS 356 Lecture 27 Internet Security Protocols. Spring 2013

Transport Layer Security Protocols

Secure Socket Layer (SSL) and Trnasport Layer Security (TLS)

SSL implementieren aber sicher!

SSL Server Rating Guide

Network Security Web Security and SSL/TLS. Angelos Keromytis Columbia University

INF3510 Information Security University of Oslo Spring Lecture 9 Communication Security. Audun Jøsang

Network Security. Computer Networking Lecture 08. March 19, HKU SPACE Community College. HKU SPACE CC CN Lecture 08 1/23

Overview of Cryptographic Tools for Data Security. Murat Kantarcioglu

SSL/TLS. What Layer? History. SSL vs. IPsec. SSL Architecture. SSL Architecture. IT443 Network Security Administration Instructor: Bo Sheng

SSL: Secure Socket Layer

Network Security [2] Plain text Encryption algorithm Public and private key pair Cipher text Decryption algorithm. See next slide

SBClient SSL. Ehab AbuShmais

Cryptography and Network Security Sicurezza delle reti e dei sistemi informatici SSL/TSL

Secure HTTP

Communication Security for Applications

HTTPS: Transport-Layer Security (TLS), aka Secure Sockets Layer (SSL)

SSL Report: ebfl.srpskabanka.rs ( )

Protocol Rollback and Network Security

Managing and Securing Computer Networks. Guy Leduc. Chapter 4: Securing TCP. connections. connections. Chapter goals: security in practice:

3.2: Transport Layer: SSL/TLS Secure Socket Layer (SSL) Transport Layer Security (TLS) Protocol

CSC Network Security

CSC 474 Information Systems Security

Einführung in SSL mit Wireshark

Introduction. Purpose. Background. Details

Lecture 7: Transport Level Security SSL/TLS. Course Admin

Secure Socket Layer (TLS) Carlo U. Nicola, SGI FHNW With extracts from publications of : William Stallings.

Introduction. Haroula Zouridaki Mohammed Bin Abdullah Waheed Qureshi

Error oracle attacks and CBC encryption. Chris Mitchell ISG, RHUL

CS Computer Security Third topic: Crypto Support Sys

Secure Socket Layer/ Transport Layer Security (SSL/TLS)

A Perfect CRIME? TIME Will Tell. Tal Be ery, Web research TL

Lecture 9: Application of Cryptography

How To Encrypt Data With Encryption

Introduction to Cryptography

SSL, PKI and Secure Communication

Client Server Registration Protocol

Differences Between SSLv2, SSLv3, and TLS

SSL Interception Proxies. Jeff Jarmoc Sr. Security Researcher Dell SecureWorks. and Transitive Trust

Overview SSL/TLS HTTPS SSH. TLS Protocol Architecture TLS Handshake Protocol TLS Record Protocol. SSH Protocol Architecture SSH Transport Protocol

Using etoken for SSL Web Authentication. SSL V3.0 Overview

What s the matter with TLS? Matthew Green Johns Hopkins University

CIS 6930 Emerging Topics in Network Security. Topic 2. Network Security Primitives

Low-Level TLS Hacking

Network Security Part II: Standards

SSL Secure Socket Layer

WEB Security & SET. Outline. Web Security Considerations. Web Security Considerations. Secure Socket Layer (SSL) and Transport Layer Security (TLS)

Message Authentication Code

Lecture 31 SSL. SSL: Secure Socket Layer. History SSL SSL. Security April 13, 2005

Message Authentication Codes

Network Security. Gaurav Naik Gus Anderson. College of Engineering. Drexel University, Philadelphia, PA. Drexel University. College of Engineering

Final exam review, Fall 2005 FSU (CIS-5357) Network Security

SSL A discussion of the Secure Socket Layer

Web Payment Security. A discussion of methods providing secure communication on the Internet. Zhao Huang Shahid Kahn

CS 758: Cryptography / Network Security

The Secure Sockets Layer (SSL)

A Study of What Really Breaks SSL HITB Amsterdam 2011

HTTPS is Fast and Hassle-free with CloudFlare

You re FREE Guide SSL. (Secure Sockets Layer) webvisions

Should You Trust the Padlock? Web Security and the HTTPS Value Chain. Keeping Current 20 November 2013 Ken Calvert

CS Final Exam

SSL GOOD PRACTICE GUIDE

Internet Engineering Task Force (IETF) Request for Comments: Category: Standards Track ISSN: A. Langley Google June 2015

Chapter 10. Network Security

ERserver. iseries. Securing applications with SSL

Transcription:

Intro Wrong Wrong2 Downgrade Summary TLS/SSL (Mis)Protecting our Connections Security Orr Dunkelman Computer Science Department University of Haifa 6 th September, 2015 Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 1/ 53

Intro Wrong Wrong2 Downgrade Summary Outline 1 Introduction to SSL/TLS 2 What Could Possibly Go Wrong? The Quick and Dirty PKI 101 CNNIC If you cannot hack them, CA them! DigiNotar Why Not Hack Them? MD5 The Silent Killer Real Life is Always Stronger Losing all Your Security in a Heartbeat No Entropy in Public Keys 3 How Not to Implement a Authenticated Encryption The POODLE Attack The BEAST Attack The Lucky13 Attack The Perfect CRIME Attack 4 Downgrade Attacks Legacy Cryptosystems FREAKing out TLS Logjam 5 Summary Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 2/ 53

Intro Wrong Wrong2 Downgrade Summary Introduction to SSL/TLS Developed by Netscape (mid 90 s) for E-Commerce SSL 1.0 never published, SSL 2.0 published in 1995 (and broken) SSL 3.0 published in 1996 (designed by Kocher, Karlton, Freier) Became IETF responsibility which re-named it TLS 1.0 Later became TLS 1.1, 1.2,... Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 4/ 53

Intro Wrong Wrong2 Downgrade Summary Working Environment SSL was designed in the mid 90 s for E-Commerce To offer transport-level security: End-to-End, On top of TCP (session-/connection- services offered by TCP), Assumptions: Server side is strong, Client side is weak, No forward secrecy needed, Server s identity to be verified by crypto (client by server s other mechanisms ), Crypto-algorithm agility needed (export control, Fortezza chip, etc.) SSL/TLS has some mechanisms for that, which are used almost entirely in the context of VPNs) Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 5/ 53

Intro Wrong Wrong2 Downgrade Summary Overview of Solution Composed of four sub-protocols: Handshake (regular + session resumption), Alert, ChangeCipherSpec, Heartbeat Handshake is the most consuming part Its rule is to allow two sides that never met to agree on a shared secret key From there, the problem is solved Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 6/ 53

Intro Wrong Wrong2 Downgrade Summary SSL (or TLS) for the Programmer Note you must check for errors! (do not use this sample in production code, or you will end in cryptohell!) InitializeSSL(); sockfd = socket(af_inet,sock_stream,0); bind(sockfd,(struct sockaddr *) &serv_addr,sizeof(serv_addr)); listen(sockfd,5); newsockfd = accept(sockfd,(struct sockaddr *) &cli_addr,clilen); sslctx = SSL_CTX_new(SSLv23_server_method()); SSL_CTX_set_options(sslctx,SSL_OP_SINGLE_DH_USE); use_cert = SSL_CTX_use_certificate_file(sslctx,"/serverCertificate.pem",SSL_FIL use_prv = SSL_CTX_use_PrivateKey_file(sslctx,"/serverCertificate.pem",SSL_FILET cssl = SSL_new(sslctx); SSL_set_fd(cSSL,newsockfd); ssl_err = SSL_accept(cSSL); read(newsockfd,buffer,nbytestoread); SSL_read(cSSL,buffer,nBytesToRead); Based on: Reminder: Check for errors! http://stackoverflow.com/questions/7698488/turn-a-simple-socket-into-an-ssl-soc Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 7/ 53

Intro Wrong Wrong2 Downgrade Summary A Standard SSL/TLS Handshake Client ClientHello(version, cipher suite, client random, sid) ServerHello(version, cipher suite, server random, sid), Cert ClientKeyExchange ChangeCipherSpec FinishedClient ChangeCipherSpec FinishedServer Mission Accomplished! Server At the end of the execution: both server and client hold a common secret string master secret (384-bit long). It depends on the randomness provided by both sides. Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 8/ 53

Intro Wrong Wrong2 Downgrade Summary Questions? Thank you very much for your attention! Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 9/ 53

Intro Wrong Wrong2 Downgrade Summary PKI CNNIC DigiNotar MD5 Real Heartbleed Entropy Well Known Issues with SSL/TLS Since day one SSL/TLS had some known issues: Restricted agility (a list of possible ciphersuites), Backward compatibility ( weaker versions), 40-bit encryption keys in use, Weak public keys (short ones), Relies on servers to turn on encryption (not on by default), Error status when secure connection fails not followed by users, Relies on standard PKI, Does not fully hide packet size Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 11/ 53

Intro Wrong Wrong2 Downgrade Summary PKI CNNIC DigiNotar MD5 Real Heartbleed Entropy The Quick (and Dirty) PKI 101 Public Key Infrastructure (PKI) is the mechanism used to connect an identity with a public key, In the context of SSL/TLS, the PKI is certificate-based: Each entity produces a public-key, The entity approaches a certifying authority (CA) and proves its identity to the CA, CA issues a certificate that connects identity and public-key The certificate is a statement signed by the CA, Signed = one needs to know the CA s public-key, But how do you know the CA s public-key? Either you know the CA in advance, or the CA got a certificate that he is a CA from some other CA... Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 12/ 53

Intro Wrong Wrong2 Downgrade Summary PKI CNNIC DigiNotar MD5 Real Heartbleed Entropy Implications of Certificate-Based PKI Any CA you trust can sign whatever certificate he wishes (mistakes, on purpose), Any CA your trusted CA trusts, can generate certificates as he wishes, Any CA who has a certificate by a CA which is trusted by your trusted CA, can generate certificates as he wishes,... Happened many times: 1 Someone obtained a Microsoft certificate once (from Verisign), 2 DigiNotar, 3 CNNIC Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 13/ 53

Intro Wrong Wrong2 Downgrade Summary PKI CNNIC DigiNotar MD5 Real Heartbleed Entropy CNNIC The Chinese are After You In 2010 the Chinese CNNIC was added to the list of trusted CAs of Firefox, In other words, any Firefox trusts certificates issued by CNNIC, Including for gmail. Or bankofamerica.com, In other words, a CA can issue certificates incorrectly, and these certificates will be accepted by you, Allows for Meet in the Middle attacks Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 14/ 53

Intro Wrong Wrong2 Downgrade Summary PKI CNNIC DigiNotar MD5 Real Heartbleed Entropy DigiNotar The Iranians are After You In 2011, a Dutch CA, DigiNotar was taken over by the Dutch government, Apparently, their systems were hacked, And their private key was used to sign rouge certificates for several domains (mostly google related), These certificates were used to spy on Iranian activists, After the forensics, DigiNotar was shut down Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 15/ 53

Intro Wrong Wrong2 Downgrade Summary PKI CNNIC DigiNotar MD5 Real Heartbleed Entropy Also Cryptographic Attacks [S+08]: At CCC08 Stevens et al. reported that they successfully generated a real-life certificate using an MD5-collision, As MD5 is a weak hash function, signatures based on it are weak, Also certificates based on it, Including RapidSSL s certificates... Flame: Microsoft admitted the Flame was also using rogue certificates, Analysis suggests that again the attack was concerning producing collisions in MD5, The collisions seem to be sub-optimal for a single-cpu attack, but optimized for large scale automation Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 16/ 53

Intro Wrong Wrong2 Downgrade Summary PKI CNNIC DigiNotar MD5 Real Heartbleed Entropy The Real Issue Obviously, joining the CA roots or hacking into a CA invalidates the entire security model. However, there are better attack vectors: Users accept all certificates (self-signed, expired, etc.) Users can be easily tricked to not use secure connections. Users... But also developers are to blame... Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 17/ 53

Intro Wrong Wrong2 Downgrade Summary PKI CNNIC DigiNotar MD5 Real Heartbleed Entropy The Real Issue (cont.) Not all applications check certificates. In [F+13] it was found out that: Of about 13,500 applications in google play that use SSL/TLS, only 17 implemented the full certificate validation correctly. Common errors: Accept all certificates (89%) Only check expiration date (7.5%) Break SSL Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 18/ 53

Intro Wrong Wrong2 Downgrade Summary PKI CNNIC DigiNotar MD5 Real Heartbleed Entropy Heartbleed Heartbeat is a sub-protocol of SSL/TLS to maintain connections alive, Roughly speaking, it s ping with variable datagram size, Due to a buffer overflow in OpenSSL, one could obtain the full memory of the other side, including keys, Yes, a buffer overflow. Again. Though the main culprit is why a ping protocol needs a variable size datagram? and yes, a buffer overflow. In 2014. Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 19/ 53

Intro Wrong Wrong2 Downgrade Summary PKI CNNIC DigiNotar MD5 Real Heartbleed Entropy The Debian Bug OpenSSL OpenSSL is the most common open source cryptographic suite (implements SSL/TLS). It handles its own key generation, on top of the /dev/random offered by the system. In September 2006, a Debian developer (kroeckx) commented out the following line: MD Update(&m,buf,j); (Actually, he commented this line twice). The reason: Valgrind complained about using an uninitialized data structure buf. Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 20/ 53

Intro Wrong Wrong2 Downgrade Summary PKI CNNIC DigiNotar MD5 Real Heartbleed Entropy The Debian Bug OpenSSL (cont.) One problem buf contained some random leftovers. Without it, the only randomness the PRNG of OpenSSL was seeded with was the process id. One of 2 15 = 32768 possible values... Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 21/ 53

Intro Wrong Wrong2 Downgrade Summary PKI CNNIC DigiNotar MD5 Real Heartbleed Entropy Impact If there are only 32,768 seeds, there are at most 32,768 different random sequences that may be produced. Even in the key generation phase of OpenSSL (and of OpenSSH). Meaning: whoever produced a public key between 2006 and the discovery (2008), used low-entropy keys. Which can be factored, reversed (signatures), etc. Lots and lots of affected systems. Including small network devices. Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 22/ 53

Intro Wrong Wrong2 Downgrade Summary PKI CNNIC DigiNotar MD5 Real Heartbleed Entropy In Theory there is no Difference between Theory and Practice... [H+12] gathered 12.8M TLS public keys and 10.2M SSH public keys. Using some quick algorithms (DJB s algorithm) they found pairs of keys that share prime numbers. Such pairs of keys allow using gcd( ) to find the prime numbers themselves (i.e., factorizing the RSA key) Which is a bad thing... Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 23/ 53

Intro Wrong Wrong2 Downgrade Summary PKI CNNIC DigiNotar MD5 Real Heartbleed Entropy Summary of [H+12] Results TLS SSH Total # of Keys 12,828,613 10,216,363 Repeated Keys (RKs) 7,770,232 (60.5%) 6,642,222 (65.0%) Vulnerable RK 714,243 (5.57%) 981,166 (9.6%) Default Keys 670,391 (5.23%) Low-entropy RK 43,852 (0.34%) Factored RSA keys 64,081 (0.5%) 2,459 (0.03%) Compromised DSA keys 105,728 (1.03%) Debian weak keys (!) 4,147 (0.03%) 53,141 (0.52%) 512-bit RSA keys 123,038 (0.96%) 8,459 (0.08%) Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 24/ 53

Intro Wrong Wrong2 Downgrade Summary PKI CNNIC DigiNotar MD5 Real Heartbleed Entropy What Went Wrong? (partial list) Sites using default keys. with certificates(!) Citrix servers using shared keys (again some with certificates). Most repeated keys ok (used in hosting services). Some low entropy of the PRNG. Many routers, server management cards, VPN devices, VoIP products, and network storage devices suffered from these issues. Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 25/ 53

Intro Wrong Wrong2 Downgrade Summary PKI CNNIC DigiNotar MD5 Real Heartbleed Entropy Questions? Thank you very much for your attention! Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 26/ 53

Intro Wrong Wrong2 Downgrade Summary POODLE BEAST Lucky13 CRIME Let s Step Back Assume we have a server which uses secure ciphers with long keys, and that the PKI is tight (including certificate pinning), and that encryption is on by default (referring from http:// into https://) and that you use a secure implementation of SSL/TLS, and the user does not click automatically yes, and add here whatever security requirement you wish Are you secure? Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 28/ 53

Intro Wrong Wrong2 Downgrade Summary POODLE BEAST Lucky13 CRIME Padding Oracle Attacks 101 Recall 1: Multiple error messages leaks internal secrets ( user does not exist vs. user/password combination does not exist ), Recall 2: Different timings leaks internal values (comparing strings one character at a time, and stopping when they differ reveals information about the strings), Padding Oracle Attacks: Play with padding of cryptographic messages either cause decryption error (which will be handled fast) or context error (decryption succeeds, but the result is junk that is later discarded by server) Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 29/ 53

Intro Wrong Wrong2 Downgrade Summary POODLE BEAST Lucky13 CRIME Cipher Block Chaining (CBC) Mode of Operation Given a plaintext P, pad P to be a multiple of the block size, Divide the padded message into n-bit blocks P 1,P 2,..., Set C 0 = IV, and encrypt C i = E k (P i C i 1 ) P1 P2 P3 P4 P5 IV E E E E E C1 C2 C3 C4 C5 Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 30/ 53

Intro Wrong Wrong2 Downgrade Summary POODLE BEAST Lucky13 CRIME Decryption Errors in CBC Decryption in CBC is performed as follows: P i = D k (C i ) C i 1 Hence, an error ǫ appears in C i (i.e., the decrypted value is C i = C i ǫ) there are only two message blocks affected: P i which will contain a complete nonsense, P i+1 which will be P i+1 ǫ, This allows selecting the change in P i+1 (at the cost of a complete non-sense in P i ) Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 31/ 53

Intro Wrong Wrong2 Downgrade Summary POODLE BEAST Lucky13 CRIME CBC Padding in SSL 3.0 Add 1 to L bytes (L being the block size in bytes), All but last byte can have whatever value needed. Last byte contains encoding of the number of added bytes. Padding not authenticated by the MAC used in SSL Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 32/ 53

Intro Wrong Wrong2 Downgrade Summary POODLE BEAST Lucky13 CRIME Basic Padding Oracle Attack against CBC with SSL 3.0 Padding Client Man in the Middle Server C = AESCBC k (M) C C 1 With the SSL padding rule, 2 C is obtained by the MitM, 3 Adversary parse C as C 1,C 2,...,C l,. Alert Alert 4 AdversaryOrr generates Dunkelman C TLS/SSL = C (Mis)Protecting,C,...,C our Connections,C Security, and 33/ 53

Intro Wrong Wrong2 Downgrade Summary POODLE BEAST Lucky13 CRIME The Magic If the decryption of C is successful, then the padding rule was checked to be correct, Namely P l 1 was decrypted such that the last byte contains a number smaller than L, In other words P l 1 = D k(c l 1 ) C l 2 = P l 1 C l 2 C l 2 = P l 1 ǫ One can play with the value ǫ (in the last byte of C l 2 ) to learn something on the last byte of P l 1. Attack can also be used to learn other bytes in the ciphertext... Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 34/ 53

Intro Wrong Wrong2 Downgrade Summary POODLE BEAST Lucky13 CRIME The POODLE Attack The POODLE Attack is a padding oracle attack against SSL 3.0 [MDK14], It is composed of three parts: Downgrading the connection from TLS 1.x into SSL 3.0, Applying a padding oracle attack, on cookies (similar to BEAST we ll describe next) Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 35/ 53

Intro Wrong Wrong2 Downgrade Summary POODLE BEAST Lucky13 CRIME The POODLE Attack (cont.) Downgrading a connection is not so hard, Just interfere as a man in the middle in the handshake, Most SSL/TLS implementations will try the strongest possible version, Then, they will slowly step down the security into legacy, When secure connection is finally established, the downgraded protocol (unlike downgraded ciphersuites) is not detected by cryptographic means Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 36/ 53

Intro Wrong Wrong2 Downgrade Summary POODLE BEAST Lucky13 CRIME The POODLE Attack (cont.) SSL/TLS applies MAC to the payload, Despite the right order being Encrypt-then-MAC, SSL/TLS uses MAC-then-encrypt: SQN HDR Payload MAC Payload tag Pad E k Based on Kenny Paterson s presentation Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 37/ 53

Intro Wrong Wrong2 Downgrade Summary POODLE BEAST Lucky13 CRIME The BEAST Attack In SSL 3.0/TLS 1.0, the IV is chosen to be the last message s last ciphertext block, This saves the need to communicate the IV, and generates security issues, The key idea one can detect whether a plaintext block has some value or not, The attack [DR11] heavily relies on the fact that the IV is known in advance First observed as a theoretical issue by Rogaway in 1995, suggested to be used against TLS in 2004 [DM04], extended by [B06] to message recovery. Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 38/ 53

Intro Wrong Wrong2 Downgrade Summary POODLE BEAST Lucky13 CRIME How to Recover Text in BEAST Assume you suspect that the first ciphertext block C encrypts the value P, Ask for the encryption of (P,P IV C), If C is the encryption of P, namely, C = E k (P IV), then the two ciphertext blocks will be the same(!) If you know most of P, you can just try the remaining few bits (by exhaustive search), Allows for a byte-by-byte (or bit-by-bit) recovery of plaintexts Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 39/ 53

Intro Wrong Wrong2 Downgrade Summary POODLE BEAST Lucky13 CRIME Obtaining Chosen Plaintext Capabilities in SSL/TLS The adversary needs to run a JavaScript on your machine (e.g., for evil.com), The adversary tries to decrypt a cookie you are using for the site target.com, Assumes the adversary sees the communication to evil.com (which is feasible), And the JavaScript needs to communicate with evil.com online Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 40/ 53

Evil.com JS code is being run, The user sends an encrypted cookie to target.com, Adversary knows the first few bytes (e.g., username = XXXX ), Adversary captures the ciphertext of the cookies, and sends to the JS, JS code uses the above attack to find an unknown byte of the first ciphertext block, Adversary tells the evil.com website when the two ciphertext blocks are the same, which means the JS can move to the next byte, This can be done by shifting the ciphertext a bit, Mitigation: Switch to TLS 1.1/1.2 (IV is randomized) Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 41/ 53 Intro Wrong Wrong2 Downgrade Summary POODLE BEAST Lucky13 CRIME Obtaining Chosen Plaintext Capabilities in SSL/TLS (cont.)

Intro Wrong Wrong2 Downgrade Summary POODLE BEAST Lucky13 CRIME The Lucky13 Attack Padding in CBC for TLS has changed, The padding is either one byte of value 00 x, two bytes of value 01 01 x, three bytes of value 02 02 02 x, etc. Oh and you can pad more than a single block, up to 256 bytes of the form FF FF... FF x, Allows for a full padding oracle attack that recovers the full plaintext, Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 42/ 53

Intro Wrong Wrong2 Downgrade Summary POODLE BEAST Lucky13 CRIME The Lucky13 Attack (cont.) Main issue: for the attack to work, adversary needs to identify what error occurred, Fortunately, there are different error message (padding failed or MAC failed), Unfortunately, these error messages are encrypted (not accessible to the adversary), But different timing, So manual suggests that both errors will take exactly the same time: Some implementations compute MAC even if padding fails, Some implementations just remove the suggested number of bytes, and running the MAC, The last option still allows for an attack Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 43/ 53

Intro Wrong Wrong2 Downgrade Summary POODLE BEAST Lucky13 CRIME The Lucky13 Attack (cont.) The MAC in use is usually HMAC, usually based on SHA256, The performance depends on the number of bytes in the message, For messages up to 55 bytes, it uses 4 compression function calls, For messages of 56 to 119 bytes, it uses 5 compression function calls, For messages of 120 to 183 bytes, it uses 6 compression function calls,... We can learn how many bytes were removed from the message! And recover plaintext, Becomes practical combined with BEAST Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 44/ 53

Intro Wrong Wrong2 Downgrade Summary POODLE BEAST Lucky13 CRIME The CRIME Attack SSL/TLS offers compression of the plaintext (better performance), But compression depends on the actual data (and is stateful), For example, high redundancy plaintexts have better compression ratios, BEAST + picking the correct padding games message recovery! [DR12], Look out for BREACH as well (as HTTP also has compression mechanism) Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 45/ 53

Intro Wrong Wrong2 Downgrade Summary Legacy FREAK Logjam The Legacy of SSL (Export Restrictions) A long time ago in a country far, far away. It was a period of liberty unrest. Liberal cryptographers, striking from their universities and companies, have won their first victory against the export restrictions. During the battle, these cryptographers came to realize the empire s ultimate weapon, the legal case for export restrictions, a set of restrictions with enough power to make any protected communications accessible to the NSA. As a result, SSL has several export-level primitives available, from 40-bit keys to short public-keys. Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 47/ 53

Intro Wrong Wrong2 Downgrade Summary Legacy FREAK Logjam FREAK Short RSA Keys Long time ago, only 512-bit RSA keys were allowed, Today, a simple Number Field Sieve can factor such an RSA moduli at the cost of 100 US$ on a cloud service provider, So, [B15] just showed that it is easy to attack such servers... Mitigations: Shut down SSL 3.0; Disable legacy crypto; Use larger primes. Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 48/ 53

Intro Wrong Wrong2 Downgrade Summary Legacy FREAK Logjam Logjam Short Diffie-Hellman Keys SSL 3.0 allows using export-level Diffie-Hellman keys, Today, such keys are insecure. More precisely, finding x from g x mod p for 512-bit prime p is feasible, If p is known in advance, the process can be done in practical time (less than 2.5 minutes), Identified by Adrian et al. [A+15] logjam is a cryptographic attack on such keys, Improved success due to the fact that two common primes (one by Apache, and one by mod ssl), cover 92% of the market share Mitigations: Shut down SSL 3.0; Disable legacy crypto. About 8% of the top 1M internet sites support that. Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 49/ 53

Intro Wrong Wrong2 Downgrade Summary Summary SSL/TLS is one of the greater successes in computer security. Widely deployed and used, Crypto agility which is easy to use, Multiple implementations to pick from, YOU MUST USE IT whenever possible. Conditions apply Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 51/ 53

Intro Wrong Wrong2 Downgrade Summary Summary (cont.) Just remember to turn off legacy options, both on server side and client side, Fix PKI (or be very very careful with it), Turn off compression (both for TLS and for HTTP), Switch to TLS 1.2, and the moment TLS 1.3 is out the door, switch to it, Set your IDSes to detect renegotiation and downgrade attacks, Use very long (and secure) public-keys, Does not protect against traffic analysis (message sizes usually not protected), BETTER TO NOT USE IT unless you must. Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 52/ 53

Intro Wrong Wrong2 Downgrade Summary Questions? Thank you very much for your attention! Orr Dunkelman TLS/SSL (Mis)Protecting our Connections Security 53/ 53