Why Web Security Is Fundamentally Broken

57
© 2012 WhiteHat Security, Inc. 1 Why Web Security Is Fundamentally Broken Jeremiah Grossman Founder & Chief Technology Officer

description

Most people are disturbed when they witness just how much of their personal information is accessible the very moment they visit a website. Then, if you give that [malicious] website just one mouse-click --- out goes even more personally identifiable data. We’re talking about full names, where you live, the town where you grew up and went to school, martial status, list of friends, sites you are logged-in to, the software you use complete with version numbers, and in some cases, your browser’s auto-complete data and history of other sites you’ve visited. All of this is performed using nothing but HTML and JavaScript. No need for memory corrupting exploits that escape the confines of the browser walls. Through a demo-driven presentation, the audience will see first-hand how and why all these attacks are possible, even in the presence of browser silent updates and the latest security improvements such as sandboxes, anti-phishing protections, and the availability of Content Security Policy, X-Frame-Options, Origin, Strict Transport Security, SSL, etc. And just so everyone is crystal clear, firewalls don’t help and neither does anti-virus software. The reason why none of this works is that these web attacks take advantage of flaws in the way the Web was designed to work! Adding insult to injury most of the techniques on display are NOT technically “new,” and this talk will cleverly wire these issues together to make a point, and tell a story. It is the story of Why Web Security Is Fundamentally Broken. Here’s the punchline: The only known ways to fix these issues adequately is to “break the Web” -- i.e. negatively impact the usability of a significant percentage of websites. Doing so directly conflicts with business interests of the current browser vendors who are looking to grow market share and advertising revenue. Their choice is simple, be less secure and more adopted, rather than secure and obscure. This is the Web security trade-off that’s being made for us.

Transcript of Why Web Security Is Fundamentally Broken

Page 1: Why Web Security Is Fundamentally Broken

© 2012 WhiteHat Security, Inc. 1

Why Web Security Is Fundamentally Broken

Jeremiah GrossmanFounder & Chief Technology Officer

Page 2: Why Web Security Is Fundamentally Broken

2

Jeremiah GrossmanØFounder & CTO of WhiteHat Security ØInternational PresenterØTED AlumniØInfoWorld Top 25 CTOØCo-founder of the Web Application Security ConsortiumØCo-author: Cross-Site Scripting AttacksØFormer Yahoo! information security officerØBrazilian Jiu-Jitsu Black Belt

Page 3: Why Web Security Is Fundamentally Broken

3

The FutureNow List

Cool Vendor

• Headquartered in Santa Clara, CA• WhiteHat Sentinel – SaaS end-to-end website risk

management platform (static and dynamic) • Employees: 220+

WhiteHat Security

Page 8: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 6

Page 9: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 6

Passive access to your operating system information, various system settings, browser type / version, installed add-ons & plug-ins, geographic location, websites currently logged-into, etc.

Today’s browsers make availabe to every website you visit:

Page 10: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 6

Passive access to your operating system information, various system settings, browser type / version, installed add-ons & plug-ins, geographic location, websites currently logged-into, etc.

Today’s browsers make availabe to every website you visit:

Your name, where you live, where you’ve been, town you grew up in and went to school, martial status, photos, and in some cases, the browser’s auto-complete data and surfing history.

Give a website just 1 mouse-click — Then it gets access to:

Page 11: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 6

Passive access to your operating system information, various system settings, browser type / version, installed add-ons & plug-ins, geographic location, websites currently logged-into, etc.

Today’s browsers make availabe to every website you visit:

Your name, where you live, where you’ve been, town you grew up in and went to school, martial status, photos, and in some cases, the browser’s auto-complete data and surfing history.

Give a website just 1 mouse-click — Then it gets access to:

All browsers also allow a [malicious] website to:Force your browser to send self-incriminating Web requests, hack your Intranet, auto-XSS / CSRF you on any website, etc.

Page 12: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page

The 2 Types of Browser Attacks

1) Attacks designed to escape the browser walls and infect the operating system with malware. (a.k.a. Drive-by-Downloads)

Security: Sandboxing, silent and automatic updates, increased software security, anti-phishing & anti-malware warnings, etc. [Enabled by default]

Security: SECURE Cookies, httpOnly, X-Frame-Options, Strict-Transport-Security, X-Content-Type-Options, Content Security Policy, EV-SSL, etc.[Opt-In by website, users can’t protect themselves]

2) Attacks that remain within the browser walls and compromise cloud-based data. XSS, CSRF, Clickjacking, etc.

Page 13: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 8

Browser InterrogationOperating System and Browser Type via User-Agent Headers User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1

Language setting, ActiveX support, and the Referer.

GET / HTTP/1.1Host: http://maliciouswebsite/User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1Accept-Language:en-US,en;q=0.8

<script>if (navigator.language) {! console.log(navigator.language);}</script>

Page 14: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 9

Browser Interrogation (cont.)ActiveX <script>if(typeof(window.ActiveXObject)=="undefined"){! console.log(“ActiveX Unavailable");} else {! console.log(“ActiveX Available");}</script>

Referer

GET / HTTP/1.1Host: http://maliciouswebsite/User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_5) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.89 Safari/537.1Referer:http://searchengine/search?q=keywords

Page 15: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 10

Browser Interrogation (cont.)Virtualization Detection via Screen Dimensions

<script>var  dimensions  =  {'320,  200'  :  '',  '320,  200'  :  '',  '320,  240'  :  '',  '640,  480'  :  '',  '800,  480'  :  '',  '768,  576'  :  '',  '854,  480'  :  '',  '1024,  600'  :  '',  '1152,  768'  :  '',  '800,  600'  :  '',  '1024,  768'  :  '',  '1280,  854'  :  '',  '1280,  960'  :  '',  '1280,  1024'  :  '',  '1280,  720'  :  '',  '1280,  768'  :  '',  '1366,  768'  :  '',  '1280,  800'  :  '',  '1440,  900'  :  '',  '1440,  960'  :  '',  '1400,  1050'  :  '',  '1600,  1200'  :  '',  '2048,  1536'  :  '',  '1680,  1050'  :  1,  '1920,  1080'  :  '',  '2048,  1080'  :  '',  '1920,  1200'  :  '',  '2560,  1600'  :  '',  '2560,  2048'  :  ''};  var  wh  =  screen.width  +  ",  "  +  screen.height;  if  (dimensions[wh]  !=  undefined)  {   console.log(“Not  virtualized");}  else  {   console.log(“OperaUng  in  a  virtualized  environment");  }</script>

Page 16: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 11

Browser Interrogation (cont.)Identifying Installed Extensions and Add-Ons

(CHROME)<script  src=”chrome-­‐extension://aknpkdffaafgjchaibgeecgmgeghloj/manifest.json  ”  onload=”extensionDetected()”>  

(Firefox)<script>if  (typeof  uniquelyNamedObject  !=  'undefined'){      console.log  ("Add-­‐On  Present");}</script>

Page 17: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 12

Page 18: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 12

<img src=”http://someotherwebsite/image.png”>

<img src=”http://someotherwebsite/image.png” onload=”successful()” onerror=”error()”>

Common use-case:

If the image file loaded correctly, the “successful” Javascript function executes. If some error occurred, obviously the “error” function executes.

Page 19: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 12

<img src=”http://someotherwebsite/image.png”>

<img src=”http://someotherwebsite/image.png” onload=”successful()” onerror=”error()”>

Common use-case:

If the image file loaded correctly, the “successful” Javascript function executes. If some error occurred, obviously the “error” function executes.

Login-Detection (via CSRF):<img src=”http://someotherwebsite/loggedin.png” onload=”loggedIn()” onerror=”notLoggedIn()”>.

If the user is logged-in, the image file loads successfully, which executes the “loggedIn.” If they’re not logged-in, “notLoggedIn” is executed.

DEMO

Page 20: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 13

Authenticated Javascript/CSSEvent Handler<script src=”http://thirdparty/javascript.js” onload=”loggedin()” onerror=”notloggedin()”></script>

Object Detection<script src=”http://thirdparty/javascript.js”> </script><script>if (typeof loggedInObject != 'undefined'){ console.log ("Logged-In");}</script>

CSS Object Detection<link rel="stylesheet" type="text/css" href="http://thirdparty/stylesheet.css" />

Page 21: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 14

Authenticated IFRAMEsiframe.contentWindow.length <iframe id=”login” src=”http://thirdparty/profile/”></iframe>

<script>if (iframe.contentWindow.length > 0) { console.log ("Logged-In");}</script>

XFO Detection<iframe id=”login” src=”http://thirdparty/profile/”></iframe>

Page 22: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 15

XFO Detection<iframe id=”login” src=”http://thirdparty/profile/”></iframe>

<script src=”http://ajax.googleapis.com/ajax/libs/dojo/1.7.2/dojo/dojo.js”></script><script>var urls = ['http://www.wikipedia.org/','http://ha.ckers.org/', 'http://www.google.com/','http://www.facebook.com/','https://github.com/','http://daringfireball.net/',];

function detect() { dojo.forEach(urls, function(url) { var iframe = dojo.create(“iframe”, { src: url, id: url }); dojo.attr(iframe, “style”, {display: ‘none’}); dojo.connect(iframe, “onload”, function() { dojo.destroy(iframe); });

dojo.place(iframe, dojo.body()); setTimeout(function () { var obj = dojo.byId(url); if (obj) { dojo.destroy(iframe); var entry = dojo.create(“li”, null, dojo.body()); entry.innerHTML = “Yes: ” + url; } else { var entry = dojo.create(“li”, null, dojo.body()); entry.innerHTML = “No: ” + url; } }, 3000); });}

Page 23: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 16

Deanonymize (via Clickjacking)

Page 24: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 16

Deanonymize (via Clickjacking)

Click For More Dancing Cats

Page 25: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 16

Deanonymize (via Clickjacking)

Click For More Dancing Cats

"A mashup is a self-inflicted XSS attack."Douglas Crockford

Page 26: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 16

Deanonymize (via Clickjacking)

Click For More Dancing Cats

"A mashup is a self-inflicted XSS attack."Douglas Crockford

DEMOhttp://mayscript.com/blog/david/clickjacking-attacks-unresolved

Page 27: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 17

“Unless you've taken very particular precautions, assume every website you visit knows exactly who you are, where you’re from, etc.”Jeremiah Grossman

Page 28: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 18

<iframe src=”http://192.168.1.1/” onload=”detection()”></iframe>

Browser Intranet HackingCirca (2006)

Page 29: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 18

Intranet

JavaScript

Malware

IP PhoneBug

Tracking

Wiki

Printer

New Web

Server

User

Firewall

HTT

<iframe src=”http://192.168.1.1/” onload=”detection()”></iframe>

Browser Intranet HackingCirca (2006)

Page 30: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 19

Page 31: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 19

DEMO

Page 32: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 20

Cross-Site Scripting (XSS)At least 55% of websites

+ Browser Auto-Complete = pwn

Cross-Site Request Forgery (CSRF)At least 19% of websites

DNS Rebinding

Page 33: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 21

Page 34: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 21

Page 35: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 21

Page 36: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 21

Page 37: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 22

Possible

Solutions?

Page 38: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 23

Page 39: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 23

Login-DetectionIdea: Do not send the Web visitors cookie data to off-domain destinations, destinations different from the hostname in the URL bar, along with the Web requests.

Page 40: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 23

Login-DetectionIdea: Do not send the Web visitors cookie data to off-domain destinations, destinations different from the hostname in the URL bar, along with the Web requests.

Breaks the WebNot sending cookies off-domain would break websites using multiple hostnames to deliver authenticated content. Breaks single-click Web widgets like Twitter “Follow,” Facebook “Like,” and Google “+1” buttons. Also breaks visitor tracking via Google Analytics, Coremetrics, etc.

Page 41: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 24

Page 42: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 24

DeanonymizationIdea: Ban IFRAMEs entirely, or at least ban transparent IFRAMEs. Ideally, browser users should be able to “see” what they are really clicking on.

Page 43: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 24

DeanonymizationIdea: Ban IFRAMEs entirely, or at least ban transparent IFRAMEs. Ideally, browser users should be able to “see” what they are really clicking on.

Breaks the WebMillions of websites current rely upon IFRAMEs, including transparent IFRAMEs, for essential functionality. Notable examples are Facebook, Gmail, and Yahoo! Mail.

Page 44: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 25

Page 45: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 25

Browser Intranet HackingIdea: Create a barrier in the browser between “public” and “private” networks by prohibit the inclusion of RFC-1918 on non-RFC-1918 websites.

Page 46: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 25

Browser Intranet HackingIdea: Create a barrier in the browser between “public” and “private” networks by prohibit the inclusion of RFC-1918 on non-RFC-1918 websites.

Breaks the WebSome organizations actually do include intranet content on public websites, for their employees, which does not violate RFC specification.

Page 47: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 25

Browser Intranet HackingIdea: Create a barrier in the browser between “public” and “private” networks by prohibit the inclusion of RFC-1918 on non-RFC-1918 websites.

Breaks the WebSome organizations actually do include intranet content on public websites, for their employees, which does not violate RFC specification.

Vulnerabilities are required by Web standards.

Page 48: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 26

bigger problem

KNOWN “WONT-FIX” ISSUES

Page 50: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 28

“[N]obody's breaking the web, dude. Not now, not ever.”Dan Kaminsky to Jeremiah Grossman, December 21, 2010

Security: SECURE Cookies, httpOnly, X-Frame-Options, Strict-Transport-Security, X-Content-Type-Options, Content Security Policy, EV-SSL, etc.

•Opt-In security, by website owners•Measurably low adoption rates•Do not allow for Web users to protect themselves

Page 51: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 29

Page 52: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 29

Web browsers are NOT “safe.” Web browsers are NOT “secure.”

Web browsers do NOT protect your “privacy.”

Page 53: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 29

Web browsers are NOT “safe.” Web browsers are NOT “secure.”

Web browsers do NOT protect your “privacy.”

Page 54: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 30

What do we do now?

Page 55: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 31

1) Status Quo2) .SECURE3) Break the Web

...

Page 56: Why Web Security Is Fundamentally Broken

© 2010 WhiteHat Security, Inc. | Page 32

Mobile Apps “DesktopApps”

Mini-browsers, where each site / app is isolated. No issues with Login Detection, Denaonymization, etc.

Custom browsers’ designed to automatically launch to a website and go no further.

Page 57: Why Web Security Is Fundamentally Broken

© 2012 WhiteHat Security, Inc.

Thank You!“I Know...” serieshttp://blog.whitehatsec.com/introducing-the-i-know-series/

Blog: http://blog.whitehatsec.com/Twitter: http://twitter.com/jeremiahgEmail: [email protected]

33