KRACK & ROCA 吳忠憲 陳君明 1,3 1,2,3. J.-S. Wu Jimmy Chen. 1. NTU, National Taiwan University 2. IKV, InfoKeyVault Technology 3.

Similar documents
Key Reinstallation Attacks: Forcing Nonce Reuse in WPA2. Mathy CCS 2017, 1 October 2017

KRACKing WPA2 by Forcing Nonce Reuse. Mathy Nullcon, 2 March 2018

KRACKing WPA2 by Forcing Nonce Reuse. Mathy Chaos Communication Congress (CCC), 27 December 2017

Frequently Asked Questions WPA2 Vulnerability (KRACK)

KRACKing WPA2 in Practice Using Key Reinstallation Attacks. Mathy BlueHat IL, 24 January 2018

Key Reinstallation Attacks: Forcing Nonce Reuse in WPA2. Mathy Vanhoef, PhD Wi-Fi Alliance meeting Bucharest, 24 October 2017

Improved KRACK Attacks Against WPA2 Implementations. Mathy OPCDE, Dubai, 7 April 2018

L13. Reviews. Rocky K. C. Chang, April 10, 2015

Discovering Logical Vulnerabilities in the Wi-Fi Handshake Using Model-Based Testing

WiFuzz: Detecting and Exploiting Logical Flaws in the Wi-Fi Cryptographic Handshake

Wireless LAN Security. Gabriel Clothier

Chapter 24 Wireless Network Security

D. The bank s web server is using an X.509 certificate that is not signed by a root CA, causing the user ID and password to be sent unencrypted.

Encryption. INST 346, Section 0201 April 3, 2018

Lecture 2 Applied Cryptography (Part 2)

Introduction to Cryptography Lecture 11

Csci388. Wireless and Mobile Security Access Control: 802.1X, EAP, and RADIUS. Importance of Access Control. WEP Weakness. Wi-Fi and IEEE 802.

Managing and Securing Computer Networks. Guy Leduc. Chapter 7: Securing LANs. Chapter goals: security in practice: Security in the data link layer

Wi-Fi Security for Next Generation Connectivity. Perry Correll Aerohive, Wi-Fi Alliance member October 2018

Key Encryption as per T10/06-103

Wireless KRACK attack client side workaround and detection

What is Eavedropping?

Module: Cryptographic Protocols. Professor Patrick McDaniel Spring CMPSC443 - Introduction to Computer and Network Security

Verifying Real-World Security Protocols from finding attacks to proving security theorems

ECE 646 Fall 2009 Final Exam December 15, Multiple-choice test

4 PKI Public Key Infrastructure

Cryptography and Network Security

Public-Key Encryption, Key Exchange, Digital Signatures CMSC 23200/33250, Autumn 2018, Lecture 7

Configuring the Client Adapter through the Windows XP Operating System

E-commerce security: SSL/TLS, SET and others. 4.1

Summary on Crypto Primitives and Protocols

Security issues: Encryption algorithms. Threats Methods of attack. Secret-key Public-key Hybrid protocols. CS550: Distributed OS.

Total points: 71. Total time: 75 minutes. 9 problems over 7 pages. No book, notes, or calculator

Configuring the Client Adapter through the Windows XP Operating System

FAQ on Cisco Aironet Wireless Security

Securing Wireless LANs with Certificate Services

The following chart provides the breakdown of exam as to the weight of each section of the exam.

CS 161 Computer Security

FIPS Security Policy for Cisco Aironet Lightweight AP1131, AP1142, AP1242, AP1252, AP1262, CAP3502e, and CAP3502i Wireless LAN Access Points

Data Security and Privacy. Topic 14: Authentication and Key Establishment

CRYPTOGRAPHY AND NETWROK SECURITY-QUESTION BANK

The Xirrus Wi Fi Array XS4, XS8 Security Policy Document Version 1.0. Xirrus, Inc.

Wireless Network Security

Acronyms. International Organization for Standardization International Telecommunication Union ITU Telecommunication Standardization Sector

Vulnerability issues on research in WLAN encryption algorithms WEP WPA/WPA2 Personal

Authentication Handshakes

Cisco Desktop Collaboration Experience DX650 Security Overview

CS Computer Networks 1: Authentication

Keywords Session key, asymmetric, digital signature, cryptosystem, encryption.

Attacking Networks. Joshua Wright LightReading LIVE! October 1, 2003

CSC 474/574 Information Systems Security

SECURITY STORY WE NEVER SEE, TOUCH NOR HOLD YOUR DATA

Security+ SY0-501 Study Guide Table of Contents

Network Encryption. Dr. Michael Ritter. September 18 th, 2015

Cryptography (Overview)

Wireless Network Security Spring 2015

Introduction to Public-Key Cryptography

Public Key Cryptography

T Cryptography and Data Security

Trojan-tolerant Hardware & Supply Chain Security in Practice

Principles of Information Security, Fourth Edition. Chapter 8 Cryptography

Spring 2010: CS419 Computer Security

CPSC 467: Cryptography and Computer Security

Cryptography and Network Security Chapter 10. Fourth Edition by William Stallings

Most Common Security Threats (cont.)

Link & end-to-end protocols SSL/TLS WPA 2/25/07. Outline. Network Security. Networks. Link and End-to-End Protocols. Link vs. End-to-end protection

CS 6324: Information Security More Info on Key Establishment: RSA, DH & QKD

Configuring the Client Adapter through Windows CE.NET

Protocols II. Computer Security Lecture 12. David Aspinall. 17th February School of Informatics University of Edinburgh

Authentication and Security: IEEE 802.1x and protocols EAP based

White Paper for Wacom: Cryptography in the STU-541 Tablet

Securing IoT applications with Mbed TLS Hannes Tschofenig Arm Limited

QUANTUM SAFE PKI TRANSITIONS

T Cryptography and Data Security

ECHONET Lite SPECIFICATION. ECHONET Lite System Design Guidelines 2011 (2012) ECHONET CONSORTIUM ALL RIGHTS RESERVED

Lecture 5: Protocols - Authentication and Key Exchange* CS 392/6813: Computer Security Fall Nitesh Saxena

Implementing Cryptography: Good Theory vs. Bad Practice

Wireless Network Security Spring 2016

Lecture 33. Firewalls. Firewall Locations in the Network. Castle and Moat Analogy. Firewall Types. Firewall: Illustration. Security April 15, 2005

CYBER ATTACKS EXPLAINED: WIRELESS ATTACKS

Cryptography in Lotus Notes/Domino Pragmatic Introduction for Administrators

Rooting Routers Using Symbolic Execution. Mathy HITB DXB 2018, Dubai, 27 November 2018

Physical and Link Layer Attacks

Connecting Securely to the Cloud

Auth. Key Exchange. Dan Boneh

Security: Focus of Control

Applied Cryptography and Computer Security CSE 664 Spring 2018

WPA-GPG: Wireless authentication using GPG Key

WAP Security. Helsinki University of Technology S Security of Communication Protocols

Key Management. Digital signatures: classical and public key Classic and Public Key exchange. Handwritten Signature

Security Protocols. Professor Patrick McDaniel CSE545 - Advanced Network Security Spring CSE545 - Advanced Network Security - Professor McDaniel

PROTECTED EXTENSIBLE AUTHENTICATION PROTOCOL

Securing Your Wireless LAN

Study Guide to Mideterm Exam

18-642: Security Vulnerabilities

Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2010

Key Management and Distribution

Wireless Terms. Uses a Chipping Sequence to Provide Reliable Higher Speed Data Communications Than FHSS

Server Tailgating A Chosen- Plaintext Attack on RDP. - Eyal Karni - Yaron Zinar - Roman Blachman

Cryptography for the Internet of Things. Kenny Paterson Information Security

Transcription:

KRACK & ROCA 吳忠憲 1,3 陳君明 1,2,3 J.-S. Wu Jimmy Chen 1. NTU, National Taiwan University 2. IKV, InfoKeyVault Technology 3. CHROOT & HITCON 1

Agenda KRACK Key Reinstallation Attacks Serious weaknesses in WPA2, a protocol that secures all modern protected Wi-Fi networks ROCA Return of Coppersmith s Attack A vulnerability in the implementation of RSA key pair generation in a cryptographic library used in a wide range of cryptographic chips 2

KRACK 3

14 Years of WPA/WPA2 1997: WEP (completely broken) 2003: WPA 2004: WPA2 Many attacks against Wi-Fi, but Handshake & encryption remain secure Until 2017 KRACK discovered by Mathy Vanhoef 4

5

10 CVE IDs for KRACKs Targeting different aspects of WPA/WPA2 CVE-2017-130{77,78,79,80,81} CVE-2017-130{82,84,86,87,88} 6

10 CVE IDs for KRACKs Targeting different aspects of WPA/WPA2 CVE-2017-130{77,78,79,80,81} CVE-2017-130{82,84,86,87,88} Let s see how to KRACK the 4-way handshake 7

Before the 4-way Handshake A client and an AP need to setup a shared secret master key MK 8

Personal Network MK = Password MK = Password MK = Password 9 MK = Password

Certificate Username Password Enterprise Network 802.1X PEAP MK1 MK3 MK2 MK4 MK5 MK1 MK2 MK5 MK3 MK4 10

The 4-way Handshake Based on a shared MK between an AP and a client Mutual authentication Negotiate a fresh temporal key TK for actual encryption can be refreshed 11

Client AP setup MK Msg1 (ANonce) setup MK compute TK Msg2 (CNonce, ) Msg3 ( ) compute TK install TK reset PN Msg4 ( ) install TK reset PN 12

WPA2 Wi-Fi Encryption 3 parameters are installed on both ends the temporal key TK the RxPN (replay counter) the TxPN (encryption nonce) Using CCM or GCM with AES-128 TK is the encryption key 13

Client AP setup MK Msg1 (ANonce) setup MK compute TK Msg2 (CNonce, ) Msg3 ( ) compute TK install TK reset PN Msg4 ( ) encrypted packets install TK reset PN 14

Client AP setup MK Msg1 (ANonce) setup MK compute TK Msg2 (CNonce, ) Msg3 ( ) compute TK install TK reset PN Msg4 ( ) encrypted packets 15

Key Reinstallation Under the same secret key If encryption nonce (TxPN) gets reset: packets can be decrypted packets can be spoofed (for GCM) If replay counter (RxPN) gets reset: packets can be replayed 16

Client (victim) Msg3 ( ) AP install TK reset PN Msg4 enc. packets timeout for Msg4 reinstall TK reset PN Msg4 Msg3 ( ) enc. packets 17

Reinstall an All-Zero Key A serious bug found in wpa_supplicant Android 6.0+ and Linux 18

Man-in-the-Middle 21:D8:29:06:B7:58 5B:16:E3:54:71:A6 Channel 2 Channel 1 5B:16:E3:54:71:A6 21:D8:29:06:B7:58 19

Many Networks are Unaffected by KRACK MK = Password MK = Password MK = Password 20 MK = Password

Properly configured HTTPS, TLS, VPN are unaffected too 21

KRACK the Wi-Fi Fast Roaming Enterprise networks with multiple APs clients are moving FT (Fast Transition) handshake MK MK Moving 22

KRACK the Wi-Fi Fast Roaming Enterprise networks with multiple APs clients are moving FT (Fast Transition) handshake similar reinstallation issue on the AP side no replay counter at all more exploitable!!! 23

No MitM Needed to KRACK FT replay handshake messages 5B:16:E3:54:71:A6 21:D8:29:06:B7:58 24

The Root Cause of KRACK The IEEE 802.11 standards didn t specify the precise behaviors Previous formal analyses didn t model key installation 4-way handshake proven secure CCM/GCM encryption proven secure 25

Fix the KRACK Vulnerabilities Both clients and APs need patches Android 6.0+ and Linux devices! APs in enterprise networks! Don t do the harmful key reinstallation Mitigate at the other end 26

Lessons Learned (1/2) Good spec & correct code Abstract model vs. reality 27

Lessons Learned (2/2) What if some part of your infrastructure is compromised? control the threats Encrypt everything properly in transit don t assume enough (if any) security from (wireless) LAN HTTPS, TLS, VPN 28

ROCA 29

Crypto Flaws on Chips EasyCard ( 悠遊卡 ) / Mifare Classic, NXP, 2008 Citizen Certificate ( 自然人憑證 ), Renesas, 2013 Coppersmith in The Wild Devices around the world, Infineon, 2017 Return of Coppersmith s Attack (ROCA) CVE-2017-15361 30

EasyCard / Mifare NXP The "Mifare Classic" RFID chip is used in hundreds of transport systems London, Boston, Los Angeles, Amsterdam, Taipei, Shanghai, Rio de Janeiro and as an access pass in thousands of companies, schools, hospitals, and government buildings all over the world The group that broke Mifare Classic is from Radboud University Nijmegen in the Netherlands The security of Mifare Classic is terrible kindergarten cryptography Source: Schneier on Security https://www.schneier.com/blog/archives/2008/08/hacking_mifare.html 31

EasyCard / Mifare NXP NXP called disclosure of the attack irresponsible, warned that it will cause immense damages The Dutch court would have none of it: Damage to NXP is not the result of the publication of the article but of the production and sale of a chip that appears to have shortcomings NXP Semiconductors lost the court battle to prevent the researchers from publishing Source: Schneier on Security https://www.schneier.com/blog/archives/2008/08/hacking_mifare.html 32

EasyCard / Mifare NXP https://www.ithome.com.tw/node/63075 33

EasyCard / Mifare NXP http://news.ltn.com.tw/news/society/paper/658204 34

Crypto Flaws on Chips EasyCard ( 悠遊卡 ) / Mifare Classic, NXP, 2008 Citizen Certificate ( 自然人憑證 ), Renesas, 2013 Coppersmith in The Wild Devices around the world, Infineon, 2017 Return of Coppersmith s Attack (ROCA) CVE-2017-15361 35

Citizen Certificate Renesas The Renesas HD65145C1 chip is a "High-Security 16-bit Smart Card Microcontroller" used in many high-security applications, including banking This chip received a certificate, that certifies the chip was conformant with Protection Profile BSI-PP-0002-2001 at Common Criteria assurance level EAL4+ HD65145C1 was used in the Chunghwa Telecom HICOS PKI Smart Card, which received FIPS 140-2 Validation Certificate at Level 2 from NIST, USA 36 Source: Coppersmith in the wild https://smartfacts.cr.yp.to/index.html

Citizen Certificate Renesas 103 Citizen Certificate using Renesas HD65145C1 chip were broken by computing GCD of RSA public moduli Some RSA moduli N 1 = p q and N 2 = p r GCD(N 1, N 2 ) = p, thus both N 1 and N 2 are factored Most frequent primes found 0xc00000000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000000000000000000002f9 0xc92424922492924992494924492424922492924992494924492424922492924 992494924492424922492924992494924492424922492924992494924492424e5 0xf6dbdb6ddb6d6db66db6b6dbb6dbdb6ddb6d6db66db6b6dbb6dbdb6ddb6d6db 66db6b6dbb6dbdb6ddb6d6db66db6b6dbb6dbdb6ddb6d6db66db6b6dbb6dbdbc1 37 Source: Coppersmith in the wild https://smartfacts.cr.yp.to/index.html

38 https://smartfacts.cr.yp.to/smartfacts-20130916.pdf

Citizen Certificate Renesas 39

http://www.moi.gov.tw/info/news_content.aspx?sn=7771&page=0 40

Lattice L = a 1 u 1 + a 2 u 2 a 1, a 2 Z } = a 1 v 1 + a 2 v 2 a 1, a 2 Z } is a 2-dim lattice u 1, u 2 : good basis v 1, v 2 : bad basis SVP (Shortest Vector Problem) is hard if the dimension is high 41 Image courtesy: https://en.wikipedia.org/wiki/lattice_reduction

Coppersmith s Attack RSA modulus N = p q If p = ax + b where a, b are known, and x is small enough, then x can be found by Don Coppersmith s algorithm Generate a lattice by known information (N, a, b), then solve SVP on the lattice 42

Crypto Flaws on Chips EasyCard ( 悠遊卡 ) / Mifare Classic, NXP, 2008 Citizen Certificate ( 自然人憑證 ), Renesas, 2013 Coppersmith in The Wild Devices around the world, Infineon, 2017 Return of Coppersmith s Attack (ROCA) CVE-2017-15361 43

ROCA ROCA Return of Coppersmith s Attack The vulnerability was discovered by Slovak and Czech security researchers from the Centre for Research on Cryptography and Security at Masaryk University, Czech Republic; Enigma Bridge Ltd, Cambridge, UK; and Ca' Foscari University of Venice, Italy 44

Prime Generation Textbook prime generation for RSA-1024 Choose a 512-bit random odd integer 1 1 510 random bits Test divisibility for small primes: 3, 5, 7, 11, Run the Miller-Rabin test enough times Reference Standard: FIPS 186-4 45

Earlier Work 46 https://www.usenix.org/node/197198

Earlier Work 47 https://www.usenix.org/node/197198

Motivation Distribution of RSA keys modulo small primes 48 https://crocs.fi.muni.cz/_media/public/papers/ccs-nemec-handout.pdf

Black-Box Attack The researchers had access neither to the library s source code nor to the object code Stored only in the secure on-chip memory and not extractable The whole analysis was performed solely using RSA keys generated and exported from the Infineon s cards and tokens Not based on any weakness in an RNG or any additional side-channel information https://crocs.fi.muni.cz/_media/public/papers/nemec_roca_ccs17_preprint.pdf 49

Infineon s Primes 50 512-bit primes (RSA-1024) are generated by p = k M + 65537 a mod M M = 2 3 5 349 353 is fixed 475 bits, the product of the first 71 primes k is a 37-bit random integer a is a 135-bit random integer The order of the cyclic subgroup 65537 in the multiplicative group Z M has 135 bits Entropy: 37 + 135 = 172 bits

Why the Formula? p = k M + 65537 a mod M = km + 65537 a um for some u Z Infineon s prime generation is much faster than the textbook method For small prime r 353, r M, r 65537 r p All trial divisions of p by small primes can be skipped Before any primality test, the probability that the candidate p is a prime has been much larger already 51

Fingerprint N = k M + 65537 a mod M p l M + 65537 b mod M q = k l M + l 65537 a mod M + k 65537 b mod M M 65537 a+b 65537 c (mod M) + 65537 a mod M 65537 b mod M RSA modulus N is generated by Infineon s chip if and only if (almost) c = log 65537 N mod M exists! 52

Discrete Logarithm How hard is solving N 65537 c (mod M)? 135-bit group order, 65537, is huge However 65537 divides Z M by Lagrange Theorem Z M = φ M = ς t M t 1 is a product of small primes, where φ is the Euler φ function Hence solving N 65537 c (mod M) by Pohlig- Hellman algorithm (divide and conquer) is pretty easy 53

Naïve Factoring N = p q = k M + 65537 a mod M l M + 65537 b mod M 65537 a+b 65537 c (mod M) Once c is found, try all possible a (hence respective b is determined), and solve for k by Coppersmith s algorithm, then p is obtained However, it fails since there are too many possibilities ( 2 135 ) for a Solution: Try smaller M M and keep primes of the same form 54

Practical Factoring N = p q = k M + 65537 a mod M l M + 65537 b mod M 65537 a +b 65537 c (mod M ) M has 286 bits with M M The cyclic subgroup 65537 in Z M has 31-bit order (possibilities of a ), which is small enough Find c, try all possible a (so respective b is determined), and solve for k (226 bits) by Coppersmith s algorithm, then p is obtained 55

RSA 1024 & 2048 97.1 CPU days to factor an RSA-1024 modulus produced by Infineon chips Parallelization is straightforward Less than 1 day if parallelized with 100 cores 140.8 CPU years to factor an RSA-2048 modulus produced by Infineon chips 56

Impacts At least tens of millions devices around the world are affected 57 https://crocs.fi.muni.cz/public/papers/rsa_ccs17

Morals Taking shortcut to enhance efficiency might compromise security hence very dangerous Secret crypto design delays the discovery of flaws hence impacts are increased 58

References KRACK https://www.krackattacks.com ROCA https://crocs.fi.muni.cz/public/papers/rsa_ccs17 59

Thank You!