26
Berkeley University of California Berkeley University of California Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android Jethro G. Beekman Christopher Thompson {jbeekman@eecs,cthompson@cs}.berkeley.edu AUGUST 13, 2013 AUGUST 13, 2013 7th USENIX WORKSHOP ON OFFENSIVE TECHNOLOGIES

Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

Berkeley University of California

Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android

Jethro G. Beekman ← Christopher Thompson {jbeekman@eecs,cthompson@cs}.berkeley.edu

AUGUST 13, 2013 AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S

Page 2: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

New phone, now what?

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 2

Hack it.

Page 3: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

Outline

•  Introduction

•  Background

•  Attack vectors

•  Solutions

• Conclusion

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 3

Page 4: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

Background

Authentication and Key Agreement IP Multimedia Subsystem

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 4

•  Introduction •  Background •  Attack vectors •  Solutions •  Conclusion

Page 5: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

Authentication and Key Agreement[1]

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 5

identity

RAND,sequence#,MACK1(rand,sequence#)

MACK2(RAND) CK=MACK3(RAND) IK=MACK4(RAND)

[1] 3GPP TS 33.102

Page 6: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

Authentication and Key Agreement[1]

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 6

identity

RAND,sequence#,MACK1(rand,sequence#)

MACK2(RAND) CK=MACK3(RAND) IK=MACK4(RAND)

challenge

response

[1] 3GPP TS 33.102

Page 7: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

IP Multimedia Subsystem

•  Telephony using Internet standards

•  SIP, TLS, etc. •  Digest Authentication (as in HTTP)

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 7

Page 8: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

•  Challenge-response protocol designed to not send HTTP passwords in the clear

Digest Authentication (HTTP)

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 8

nonce

username,H(username,password,nonce)

Client Server

Page 9: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

Digest AKA[2]

•  Overload nonce as AKA “challenge” •  Overload password as AKA “response”

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 9

identity

AKA challenge

H(AKA response) [2] RFC 3310

Page 10: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

A!ack vectors

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 10

•  Introduction •  Background •  Attack vectors •  Solutions •  Conclusion

Page 11: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

The complete system

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 11

identity

challenge

response

secured w/ CK,IK

Page 12: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

The complete system redux

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 12

←challenge →response,CK,IK

←challenge →response CK,IK

←challenge →H(response) ???

Page 13: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

Digest AKA is not enough!

•  RFC about Confidentiality and Integrity keys:

“ […] this document does not specify the use of these additional keys, they may be used for […] additional security [with some undefined] security mechanism.”

•  “Additional security”?

Without CK/IK, you get no security!

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 13

Page 14: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

SIPS (TLS)

•  What if channel security depends on TLS? •  Example: T-Mobile Wi-Fi Calling – SIP server cert chain root not standard… – …and not included in app → classic MITM

– Android apps commonly flunk TLS security[3]

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 14

[3] Fahl et al., ACM CCS 2012

Page 15: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

False base station a!ack

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 15

identity

challenge

response

CK,IK?

identity

challenge

H(response)

not needed! x

Page 16: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

Android SIM card interface

•  requestIsimAuthentication ←challenge →response,CK,IK

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 16

Page 17: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

Malware a!ack

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 17

identity

challenge

response

identity

challenge

H(response)

Page 18: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

Imposter a!ack

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 18

identity

challenge

response,CK,IK

identity

challenge

response

secured w/CK,IK

Page 19: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

requestIsimAuthentication permissions

•  READ_PHONE_STATE PHONE CALLS Read phone state and identity Allows the application to access the phone features of the device. An application with this permission can determine the phone number and serial number of this phone, whether a call is active, the number that call is connected to and the like.

– ⅓ of apps request this[4]

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 19

[4] Felt et al., USENIX WebApps 2011

Page 20: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

Impact

•  Classic MITM attack –  T-Mobile customers with Wi-Fi Calling (before update)

•  Fake base station attack –  3G/IMS providers that use AKAv1

•  Malware attack –  3G/IMS providers with Android 4.0+ customers

•  Imposter attack –  3G providers with Android 4.0+ customers

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 20

Page 21: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

Solutions

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 21

•  Introduction •  Background •  Attack vectors •  Solutions •  Conclusion

Page 22: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

T-Mobile Wi-Fi Calling

•  TLS problems[5] reported December 2012

•  Fixed (OTA update) March 2013 – Fix looks ok

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 22

[5] Beekman, Thompson, UCB/EECS-2013-18

(Classic MITM attack)

Page 23: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

Digest AKAv1

•  Confidentiality and Integrity keys MUST be used – e.g. TLS renegotiation with pre-shared key

•  AKAv2[6] uses CK,IK in hash –  IMS specifies use of AKAv1[7]

– TLS and Digest AKAv2 should suffice if server is authenticated another way

– Does not protect against malware attacks

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 23

[6] RFC 4169 [7] 3GPP TS 33.203

(False base station attack)

Page 24: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

requestIsimAuthentication

•  API should not be accessible •  At least require appropriate permissions – e.g. “Services that cost you money”

•  Reported to Google June 2013 – Current status unknown

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 24

(Malware and Imposter attacks)

Page 25: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

Conclusion

4 attacks 3 implementation errors 1 cross-protocol issue

4 solutions

AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S 25

•  Introduction •  Background •  Attack vectors •  Solutions •  Conclusion

Page 26: Breaking Cell Phone Authentication: Vulnerabilities in AKA ... · Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android ... 3GPP TS 33.102 . Berkeley University

Berkeley Universit y of California

Berkeley University of California

Breaking Cell Phone Authentication: Vulnerabilities in AKA, IMS, and Android

Jethro G. Beekman ← Christopher Thompson {jbeekman@eecs,cthompson@cs}.berkeley.edu

AUGUST 13, 2013 AUGUST 13, 2013 7 t h U S E N I X W O R K S H O P O N O F F E N S I V E T E C H N O L O G I E S