01a-04-time does not · anti-clickjacking •x-frame-options is an anti-clickjacking mechanism...

25
Time does not heal all wounds: A longitudinal analysis of security-mechanism support in mobile browsers Meng Luo , Pierre Laperdrix, Nima Honarmand, Nick Nikiforakis NDSS Symposium San Diego, February 25 th , 2019

Upload: others

Post on 24-Mar-2020

15 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

Time does not heal all wounds: A longitudinal analysis of security-mechanism support in mobile browsers

Meng Luo, Pierre Laperdrix, Nima Honarmand, Nick Nikiforakis

NDSS SymposiumSan Diego, February 25th, 2019

Page 2: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

2

2

47.8%52.2%

Traffic from mobile vs. desktop

Page 3: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

3

Client-side attacks/preventions

3

Cross-site scripting (XSS), cross-site request forgery (CSRF), SSL stripping, clickjacking, …

Isolating different origins: Same-origin policy (SOP), Content Security Policy (CSP), X-Frame-Options, iframe sandboxing

Defending against man-in-the-middle attacks: HTTP Strict-Transport-Security (HSTS), block-all-mixed-content, upgrade-insecure-requests

Protecting cookies and enhancing privacy: Security-related flags for HTTP cookies, referrer policy

DEFENSES

ATTACKS

Page 4: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

4

Motivation• Hundreds of mobile browsers are available in the market – each

advertising unique featuresBuilt-in anti-tracking capabilitiesVoice controlIncreased performance

• Two users may get substantially different security guarantees depending on the browser they utilize• No prior work on the adoption of security mechanisms in

mobile browsers

Page 5: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

5

Automated testing framework

Control Computer

Android Debug Bridge (ADB)

Web Server

Testing pages

Evaluation results

Evaluation logic

Top 20 mobile browsers Testing framework

Page 6: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

6

Security mechanisms

6

Category Content # tests

Same-origin Policy DOM access, cookie scope, XMLHttpRequest and worker 33

Content Security Policy Fetch (e.g. script-src) and other directives (e.g. form-action, frame-ancestors and upgrade-insecure-requests)

253

Cookie Secure, HttpOnly and SameSite flags 11

Referrer policy no-referrer-when-downgrade (default) and other values (e.g. no-referrer, origin, same-origin and strict-origin)

62

Iframe sandbox JavaScript execution, form submission and top-level navigation 3

X-Frame-Options Deny, SameOrigin and Allow-From values 30

Strict-Transport-Security Basic and includeSubDomains value 2

X-Content-Type-Options Script sniffing opt-out 1

total 395

Page 7: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

7

Evaluation• 395 tests 351 browsers >138K vulnerability reports• Gauging the success/failure of a test,

Support -> “secure” Lack of support -> “vulnerable”

• Analyzing vulnerability reports:Longitudinal analysis capturing evolution of security-mechanism supportDependencies between security-mechanism support and underlying

Android systemCase studies of common vulnerabilities

7

Page 8: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

Longitudinal analysis

Page 9: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

9

Adoption trend (1)• Do browsers support more security mechanisms over time?

9

●●

● ● ●

20

40

60

2013 2014 2015 2016 2017 20182012 2013 2014 2015 2016 2017 20182011 2012 2013 2014 2015 2016 2017 20182013 2014 2015 20162015 2016 20172012 2013 2014 2015 2016Browser release time (year)

Avg

# of

vul

nera

bilit

yBrowser:

●com.android.chrome com.UCMobile.intl org.mozilla.firefoxcom.jiubang.browser org.adblockplus.browser com.boatbrowser.free

UC vs. Firefox:more downloads,

more vulnerabilities

Jiubang & Boat browser:Vulnerable to >60 tests (millions of downloads), not updated since 2016

CSP is excluded

Page 10: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

10

Adoption trend (2)• Is there any difference in the support rate of security mechanisms?

10

●●

●●

●0

25

50

75

100

201320132013201320132013201320132013 201420142014201420142014201420142014 201520152015201520152015201520152015 201620162016201620162016201620162016 201720172017201720172017201720172017 201820182018201820182018201820182018Browser release time (year)

% v

ulne

rabl

e br

owse

r fam

ilies

Category:●

SOP CSP−level 1 CSP−level 2&3Cookie Referrer−Policy X−Frame−OptionsStrict−Transport−Security X−Content−Type−Options Sandbox

HSTS starts with little support, but is eventually as widely supported as Same-origin Policy

Page 11: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

11

Window of vulnerability (1)• Time window of vulnerability

• Crawl snapshots of Alexa top 5K websites• Obtain the earliest time when any website first utilizes a given

security mechanism

11

Websites explicitly ask

A Browser starts supporting

Page 12: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

12

Window of vulnerability (2)• The adoption of security mechanisms on mobile browsers is

significantly slower than on desktop browsers

12

Security mechanisms

Website request

Chrome desktop

Firefox desktop

First mobile support

50% mobile support

75% mobile support

CSP 2011 2011 2011 2011 2014 (+3) 2015 (+4)

Cookie <2011 2011 2009 2011 2013 (+2) 2014 (+3)

Referrer-Policy 2016 2012 2015 2015 2018 (+3) Not yet

X-Frame-Options <2011 2010 2010 2011 2013 (+2) 2014 (+3)

HSTS <2011 2010 2011 2011 2015 (+4) 2016 (+5)

X-Content-Type-Options <2011 2008 2011 2011 2013 (+2) 2015 (+4)

Page 13: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

13

Security regression (1)• Definition: a browser version stops supporting a security

mechanism that was supported by an earlier version• Types of security regressions:

temporary regressionpermanent regression

• 55% browser families show regressions

13

Page 14: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

14

Security regression (2)

14

0

5

10

15

20

25

SOP CSP CookieReferrer−Policy

X−Frame−Options

Strict−Transport−Security

X−Content−Type−Options

Iframe sandbox

Security mechanism category

% b

rows

er fa

milie

sRegression type:

Permanent regressionTemporary regression

Given the complexity of Content Security Policy (CSP), most regressions occur in adopting CSP

Page 15: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

15

Security regression (3)• Security regressions in top-5 browsers• The red symbol indicates the presence of security regression

15

Mechanism Chrome UC Firefox Opera Opera miniSOPCSPCookieReferrer-PolicyX-Frame-Options

HSTS

X-Content-Type-OptionsSandbox

UC browser shows frequent security regressions

Opera stops supporting HSTS from v.15 to v.26 (1 year), thereby exposing users to MITM attacks

Page 16: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

Studying latest mobile browsers

Page 17: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

17

Relationship between security and underlying OS

• Many mobile browsers are developed using WebView• The version of WebView depends on the underlying Android

systemMore recent versions support more security mechanisms

• Two users who utilize the latest version of the same browser, can experience vastly different levels of security.

17

Page 18: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

18

Vulnerability vs. Android version

18

NA NA

NA

5.16.0

7.1

com.android.chrome

com.UCMobile.intl

org.mozilla.firefox

com.opera.browser

com.opera.mini.native

com.uc.browser.en

mobi.mgeek.TunnyBrowser

com.ksmobile.cb

com.yandex.browser

com.explore.web.browser

com.mx.browser

com.htc.sense.browser

com.asus.browser

com.dolphin.browser.express.web

com.baidu.browser.inter

com.appsverse.photon

com.apusapps.browser

com.jiubang.browser

org.adblockplus.browser

com.boatbrowser.free

0

25

50

75

100

0

25

50

75

100

0

25

50

75

100

Browser family

% v

ulne

rabi

lity

Category: SOP CSP Cookie Referrer−Policy X−Frame−Options Strict−Transport−Security X−Content−Options Sandbox

The security level is promoted (less vulnerabilities), as newer Android system versions are used

Page 19: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

19

Vulnerability vs. Android version

19

NA NA

NA

5.16.0

7.1

com.android.chrome

com.UCMobile.intl

org.mozilla.firefox

com.opera.browser

com.opera.mini.native

com.uc.browser.en

mobi.mgeek.TunnyBrowser

com.ksmobile.cb

com.yandex.browser

com.explore.web.browser

com.mx.browser

com.htc.sense.browser

com.asus.browser

com.dolphin.browser.express.web

com.baidu.browser.inter

com.appsverse.photon

com.apusapps.browser

com.jiubang.browser

org.adblockplus.browser

com.boatbrowser.free

0

25

50

75

100

0

25

50

75

100

0

25

50

75

100

Browser family

% v

ulne

rabi

lity

Category: SOP CSP Cookie Referrer−Policy X−Frame−Options Strict−Transport−Security X−Content−Options Sandbox

A common vulnerability is: “Allow-From” value of X-Frame-Options header is not respected

Page 20: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

20

Vulnerability vs. Android version

20

NA NA

NA

5.16.0

7.1

com.android.chrome

com.UCMobile.intl

org.mozilla.firefox

com.opera.browser

com.opera.mini.native

com.uc.browser.en

mobi.mgeek.TunnyBrowser

com.ksmobile.cb

com.yandex.browser

com.explore.web.browser

com.mx.browser

com.htc.sense.browser

com.asus.browser

com.dolphin.browser.express.web

com.baidu.browser.inter

com.appsverse.photon

com.apusapps.browser

com.jiubang.browser

org.adblockplus.browser

com.boatbrowser.free

0

25

50

75

100

0

25

50

75

100

0

25

50

75

100

Browser family

% v

ulne

rabi

lity

Category: SOP CSP Cookie Referrer−Policy X−Frame−Options Strict−Transport−Security X−Content−Options Sandbox

UC Mini browser has the exact same and biggest number of vulnerabilities regardless of Android versions

Page 21: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

Case studies: the impact of browser vulnerabilities on web apps

Page 22: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

22

Anti-clickjacking• X-Frame-Options is an anti-clickjacking mechanism• Chrome and WebView-based browsers discard the entire header

when the “allow-from” directive is used• 231/10,752 websites (from Alexa top 50K) that make use of the

X-Frame-Options, are using “allow-from”• 175/231 websites do not utilize CSP’s “frame-ancestors”

Most of these websites have user accounts that could be abused through a clickjacking attack

American and Russian banking sitesGovernment sites of US, China, Brazil and IndiaCloud instrumentation services 22

Page 23: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

23

CSRF and SameSite• CSRF occurs when a malicious website forges requests to

perform unwanted actions on a vulnerable web app on behalf of an authenticated user• The SameSite mechanism prevent browsers from attaching

cookies to cross-site requests• 93 websites (from Alexa top 50K) utilize SameSite, including an

Italian bank and the biggest streaming platform• Users of the above web apps may not be protected against CSRF

if they use mobile browsers that do not support this mechanismUC browser, Opera Mini

23

Page 24: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

24

Conclusion• Developed 395 tests to evaluate security-mechanism support• 395 tests 351 mobile browsers 138K tests• Analyzed the evolution of security-mechanism support

Quantified trends in the support of different security mechanismsMulti-year window of vulnerability for all security mechanismsObserved security regressions

• Security-mechanism support may depend on the underlying OS• We need tools that can adapt to a user’s mobile environment and

employ different security mechanismsE.g., upon detecting that ‘allow-from’ is not supported, emit ‘frame-

ancestors’ CSP directive 24

Page 25: 01a-04-time does not · Anti-clickjacking •X-Frame-Options is an anti-clickjacking mechanism •Chrome and WebView-based browsers discardthe entire header when the “allow-from”

25

25

[email protected]

THANK YOU