session id: idy-f01 the emperor’s new password · pdf filemanager: security analysis of...

41
SESSION ID: #RSAC Zhiwei Li The Emperor’s New Password Manager: Security Analysis of Password Managers IDY-F01 Research Scientist Shape Security @liwaius * collaborated with Warren He, Devdatta Akhawe, and Dawn Song from UC Berkeley

Upload: hacong

Post on 28-Mar-2018

231 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

SESSION ID:

#RSAC

Zhiwei Li

The Emperor’s New Password Manager: Security Analysis of Password Managers

IDY-F01

Research ScientistShape Security

@liwaius

* collaborated with Warren He, Devdatta Akhawe, and Dawn Song from UC Berkeley

Page 2: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

20 years later …

2

Page 3: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

3

Page 4: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

4

Page 5: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Kids Cyber Safe?

5

Page 6: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Password Managers to the rescue

Physically Effortless Resilient to Phishing Memorywise Effortless Scalable for Users Resilient to Physical Observation Resilient to Throttled Guessing Resilient to Unthrottled Guessing Resilient to Leaks from Other Verifiers …

6

Page 7: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Keep All of Your Logins Secure With XXXX

XXXX Offers NSA-Level Protection for Your Passwords

XXXX: Unbreakable Passwords That You Don’t Have to Remember

XXXX Wins Best Mobile App at CES 2014

XXXX Never Forget a Password Again

XXXX Surpasses Gmail for Top Productivity App

XXXX is a must-use freeware tool that supports multiple operating systems and browsers

Apps to Protect Your Array of Passwords

7

Page 8: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

8

Page 9: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Are they truly secure?

LastPass

RoboForm

My1login

PasswordBox

NeedMyPassword

9

Page 10: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

How does it work?

dropbox.com

Alice (User)

10

Page 11: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Security Goals

Master Account Security impossible for an attacker to authenticate as

the user to the password manager

Credential Database Security ensure the CIA of the credential database

Unlinkability use of password manager should not

allow colluding web applications to track a single user across websites

11

Page 12: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Threat model

Web attacker control web servers DNS domains get a victim to visit controlled domains

12

Page 13: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Four classes of vulnerabilities

NO product was safe against all four

BookmarkletVulnerabilities

WebVulnerabilities

AuthorizationVulnerabilities

UIVulnerabilities

LastPass

RoboForm

My1Login

PasswordBox

NeedMyPassword

Vulnerable

Not discovered

NA

13

Page 14: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Bookmarklet Vulnerabilities

Page 15: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Bookmarklet

A bookmarklet is a snippet of JavaScript code install as a bookmark when clicked, run in the context

of the current page interact with a login form

15

Page 16: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Alice clicks bookmarklet, which includes _LASTPASS_RAND and h

16

Page 17: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Bookmarklet code is a stub that loads the main code from lastpass.com

17

Page 18: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Bookmarklet loads a LastPass page in an iframe

18

Page 19: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

The iframe loads Alice’s encrypted master key and encrypted credential for dropbox.com (specified

by a URL parameter).

This is done using a <script> tag in the iframe.19

Page 20: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

PostMessage communicates the decryption key to the iframe, which decrypts the credential and

sends it back through PostMessage

20

Page 21: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

LastPass Bookmarklet Attack

21

Page 22: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Leaking sensitive data into untrusted pages

All password managers that support bookmarklet leak their credentials LastPass RoboForm My1login

22

Page 23: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Classic Web Vulnerabilities

Page 24: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Web Vulnerabilities

Subtleties of the web platform

Focus on CSRF and XSS

CSRF vulnerabilities LastPass, RoboForm, and NeedMyPassword

XSS vulnerability NeedMyPassword

24

Page 25: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

LastPass CSRF Vulnerability

OTP feature authentication code for the master account only valid for one use

Design flaw

25

Page 26: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

h = hash(hash(alice|otp)|otp)rand_encrypted_key = encrypt(masterkey, hash(alice|otp))

26

Page 27: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

OTP Attackh = hash(hash(alice|otp)|any_otp)rand_encrypted_key = encrypt(dummy, hash(alice|any_otp))

The attacker can then log into Alice’s master account to view unencrypted information and delete credentials

27

Page 28: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Authorization Vulnerabilities

Page 29: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Collaboration

Ability to share passwords with a collaborator

Bob (Collaborator) Alice requests to share a credential

with Bob Password manager forwards the

credential to Bob Both need accounts with the password

manager

Alice (User)

29

Page 30: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Authorization Vulnerabilities

3 support credential sharing

Both My1login and PasswordBox mistook authentication for authorization

30

Page 31: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

31

Page 32: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

PasswordBox

32

Page 33: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSACUser Interface Vulnerabilities

Page 34: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

User Interface Vulnerabilities

Resilient to Phishing a major benefit of password managers detects application (auto-)fill the right password

Vulnerable LastPass RoboForm

34

Page 35: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Logging into RoboForm

Creates an iframe in the current web application to log in the user

Attack block the iframe spoof an authentication dialog steal master credentials

iframe35

Page 36: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

LastPass UI Vulnerability

36

Page 37: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Mitigation

Page 38: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Apply Slide

Bookmarklet Vulnerabilities loads the password manager code in an iframe postMessage with the right target consider DJS (Defensive JavaScript)

proposed by Karthikeyan Bhargavan

Web Vulnerabilities Content Security Policy (CSP) CSRF prevention

Authorization Vulnerabilities simplify sharing logic

UI Vulnerabilities manually open a new tab

38

Page 39: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Take Homes

Design and implement with security in mind

Formalizing (better yet verifying) protocol pays off

39

Page 40: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Conclusions

A wide spectrum of discovered vulnerabilities logic mistakes misunderstanding about the web security model typical vulnerabilities like CSRF and XSS

A single solution is unlikely

Developing password manager entails a systematic, defense-in-depth approach

40

Page 41: SESSION ID: IDY-F01 The Emperor’s New Password · PDF fileManager: Security Analysis of Password Managers. ... Keep All of Your Logins Secure With XXXX ... XXXX Wins Best Mobile

#RSAC

Stay Tuned.http://pepperword.com

41