121
Web (2.0) Security Ben Adida CRCS Seminar 18 April 2007

Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Web (2.0) SecurityBen Adida

CRCS Seminar18 April 2007

Page 2: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

web browsers in 1999 were dumb clients.

web security was aboutprotecting the server from a rogue client.

Page 3: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

web browsers in 2007 are platforms.

web security is aboutprotecting applications

from each other.

Page 4: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

It is worth understanding this platform, our de-factoTrusted Computing Base.

Installed Base> 1 Billion

Page 5: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Evolution of Web Security

• Basics of HTTP/HTML

• Web 1.0 Security Issues

• Advanced HTTP/HTML/Javascript

• Web 2.0 Security Issues

• A Few Proposals

Page 6: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

“Using encryption on the Internet is the equivalent of arranging an armored car to

deliver credit card information from someone living in a cardboard box to someone living on a park bench.”

Gene Spafford

SSL?

Page 7: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client
Page 8: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

OS

Page 9: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

OS

Database

Page 10: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

OS

Database

Web Server

Page 11: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

OS

Database

Web ServerPasswordCracks

Page 12: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

OS

Database

Web ServerPasswordCracks

BufferOverflow,

etc..

Page 13: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

OS

Database

Web Server

Application Code

PasswordCracks

BufferOverflow,

etc..

Page 14: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

OS

Database

Web Server

Application Code

PasswordCracks

BufferOverflow,

etc..

Page 15: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

OS

Database

Web Server

Application Code

PasswordCracks

BufferOverflow,

etc..

Application-LevelAttacks

Page 16: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Basics of HTTP

Page 17: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

cnn.com

User

Page 18: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

cnn.com

User

GET/2007/TECH/space/

04/17/

space.shuttle.ap/

index.html

Page 19: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

cnn.com

User

GET/2007/TECH/space/

04/17/

space.shuttle.ap/

index.html

<p><b>CAPE CANAVERAL, Florida</b> (AP) -- NASA will try...

Page 20: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

WordPress Blog

User

Page 21: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

WordPress Blog

User

GET/?p=218

Page 22: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

WordPress Blog

User

GET/?p=218

<div class="entry"><p>Speaker: Ben Adida, Harvard<br />

Page 23: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

gmail.com

User

Page 24: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

gmail.com

User

POST/send_email

[email protected]

&subject=Talk

&body=...

Page 25: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

gmail.com

User

<div>message sent.<br />

POST/send_email

[email protected]

&subject=Talk

&body=...

Page 26: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client
Page 27: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client
Page 28: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client
Page 29: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client
Page 30: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client
Page 31: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

cnn.com

User

Page 32: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

cnn.com

User

GET/article

Page 33: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

cnn.com

User

GET/article

Set-Cookie:

uid=12345

Page 34: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

cnn.com

User

GET/article

Set-Cookie:

uid=12345 Cookie:

uid=12345

Page 35: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Web 1.0 Security

Page 36: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

The web site is an API with a security policy.

Can the API be hijacked?

Page 37: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Discovering Secret API Calls

Page 38: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Discovering Secret API Calls

Page 39: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Illegal Inputs

Page 40: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Illegal Inputshttp://acme.com/view-user?id=4

Page 41: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Illegal Inputshttp://acme.com/view-user?id=4

select name, email from userswhere USERID = $id;

Page 42: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Illegal Inputshttp://acme.com/view-user?id=4

select name, email from userswhere USERID = $id;

view-user?id=NULL union select password as name, email from users

where USERID=4

Page 43: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Illegal Inputshttp://acme.com/view-user?id=4

select name, email from userswhere USERID = $id;

view-user?id=NULL union select password as name, email from users

where USERID=4

select name, email from userswhere USERID = NULL union select password as name, email from users where USERID=4;

Page 44: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Spoofed Inputs

Page 45: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Spoofed Inputs<form action=”buy-tickets”><inputtype=”hidden”name=”adult_price”value=”9.5” />

...</form>

Page 46: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Spoofed Inputs<form action=”buy-tickets”><inputtype=”hidden”name=”adult_price”value=”9.5” />

...</form>

Happens when the server-side software stack provides (poor) high-level abstractions.

Page 47: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Third-Party Cookies

Page 48: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Third-Party Cookies

Page 49: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Third-Party Cookies

Page 50: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Third-Party Cookies

Ads are now delivered in IFRAMES,which can get around third-party restrictions.

Page 51: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Advanced HTTP/HTML/Javascript

Page 52: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Web Pages are Programs

Page 53: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

<head> <title>Random Blog</title>

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script>

</head>

Web Pages are Programs

Page 54: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client
Page 55: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

document.getElementById(‘article_content’).innerHTML;

Introspection

Page 56: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

document.getElementById(‘article_content’).innerHTML;

Introspection

var req = new XMLHttpRequest();

req.onreadystatechange = function() {if (req.readyState == 4) { // do something with req.responseText}

};

req.open(“GET”, “/more-data”, true);req.send(“”);

Network Requests

Page 57: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

document.getElementById(‘article_content’).innerHTML;

Introspection

var req = new XMLHttpRequest();

req.onreadystatechange = function() {if (req.readyState == 4) { // do something with req.responseText}

};

req.open(“GET”, “/more-data”, true);req.send(“”);

Network Requests

document.getElementById(‘menu’).style.display = ‘none’;

var i = document.createElement(‘img’);i.src = ‘http://otherdomain.com/photo2.jpg’;document.body.appendChild(i);

Modifying the Page

Page 58: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

BigBank.com

User

MyFriendBook.com

BigBank.com Cookie

sessionid=8d8c93200

Page 59: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

BigBank.com

User

MyFriendBook.com

BigBank.com Cookie

sessionid=8d8c93200

GET/friends

Page 60: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

BigBank.com

User

MyFriendBook.com

BigBank.com Cookie

sessionid=8d8c93200

GET/friends

Bank balance

stealing code

Page 61: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

BigBank.com

User

MyFriendBook.com

BigBank.com Cookie

sessionid=8d8c93200

GET/friends

Bank balance

stealing code

GET/balance

Page 62: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

BigBank.com

User

MyFriendBook.com

BigBank.com Cookie

sessionid=8d8c93200

GET/friends

Bank balance

stealing code

GET/balance

$42

Page 63: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

BigBank.com

User

MyFriendBook.com

BigBank.com Cookie

sessionid=8d8c93200

GET/friends

Bank balance

stealing code

GET/balance

$42

$42

Page 64: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

BigBank.com

User

MyFriendBook.com

BigBank.com Cookie

sessionid=8d8c93200

GET/friends

Bank balance

stealing code

GET/balance

$42

$42

Page 65: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Intranet

User

MyFriendBook.com

Page 66: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Intranet

User

MyFriendBook.com

GET/friends

Page 67: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Intranet

User

MyFriendBook.com

GET/friends

Port scan

code

Page 68: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Intranet

User

MyFriendBook.com

GET/friends

Port scan

code

GET/employees

Page 69: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Intranet

User

MyFriendBook.com

GET/friends

Port scan

code

GET/employees

"Alice,

Bob,..."

Page 70: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Intranet

User

MyFriendBook.com

GET/friends

Port scan

code

"Alice,

Bob,..."GET

/employees

"Alice,

Bob,..."

Page 71: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Intranet

User

MyFriendBook.com

GET/friends

Port scan

code

"Alice,

Bob,..."GET

/employees

"Alice,

Bob,..."

Page 72: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Cross-Domain Imagesflickr.com

User

MyBlog.com

Page 73: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Cross-Domain Imagesflickr.com

User

MyBlog.com

GET/post?id=3

Blog Post w/

Inline image

Page 74: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Cross-Domain Imagesflickr.com

User

MyBlog.com

GET/post?id=3

Blog Post w/

Inline image

GET/photo

Page 75: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Cross-Domain Imagesflickr.com

User

MyBlog.com

GET/post?id=3

Blog Post w/

Inline image

GET/photo

Page 76: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Cross-Domain Scripts

Page 77: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Cross-Domain Scripts<head> <title>Random Blog</title>

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script>

</head>

Page 78: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Cross-Domain Scripts<head> <title>Random Blog</title>

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script>

</head>

var new_script = document.createElement(‘script’);

new_script.src = ‘http://otherdomain.com/’;

document.head.appendChild(new_script);

Page 79: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Cross-Domain Scripts<head> <title>Random Blog</title>

<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script>

</head>

var new_script = document.createElement(‘script’);

new_script.src = ‘http://otherdomain.com/’;

document.head.appendChild(new_script);

Page 80: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

State of Cross-Domain

• Cross-Domain outgoing messages can always be sent (using parameters in an IMG url or SCRIPT or submitted FORM)

• Cross-Domain incoming data can be integrated in limited ways:

➡ images rendered, but opaquely➡ scripts executed, but opaquely

Page 81: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

JSON and Callbacks

Page 84: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

JSON and Callbacks[ ["ct","Alice","[email protected]"], ["ct","Bob","[email protected]"], ...]

Easy data format which can be parsedusing any programming language, especially JS.

Hacked Cross-Domain!

JSONP_CALLBACK([ ["ct","Alice","[email protected]"], ["ct","Bob","[email protected]"], ...]);

Page 85: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Web 2.0 Security

Page 86: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Cross-Site Scripting (XSS)Evil.org

User

MyFriendBook.com

Eve

Page 87: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Cross-Site Scripting (XSS)

Malicious Code

posted on

personal profile

Evil.org

User

MyFriendBook.com

Eve

Page 88: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Cross-Site Scripting (XSS)

Malicious Code

posted on

personal profile

GET/eve

Evil.org

User

MyFriendBook.com

Eve

Page 89: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Cross-Site Scripting (XSS)

Malicious Code

posted on

personal profile

GET/eve

Normal Page +

Malicious Injected Code

Evil.org

User

MyFriendBook.com

Eve

Page 90: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Cross-Site Scripting (XSS)

POST or GET/steal_cookie?

friendbook_id=3234

Malicious Code

posted on

personal profile

GET/eve

Normal Page +

Malicious Injected Code

Evil.org

User

MyFriendBook.com

Eve

Page 91: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Cross-Site Request Forgery (CSRF)BigBank.com

User

MyFriendBook.com

BigBank.com Cookie

sessionid=8d8c93200

Page 92: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Cross-Site Request Forgery (CSRF)

GET/eve

Malicious Code

BigBank.com

User

MyFriendBook.com

BigBank.com Cookie

sessionid=8d8c93200

Page 93: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Cross-Site Request Forgery (CSRF)

POST/transfer

GET/eve

Malicious Code

BigBank.com

User

MyFriendBook.com

BigBank.com Cookie

sessionid=8d8c93200

Page 94: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

CSRF + JavaScript/JSON

http://jeremiahgrossman.blogspot.com/

Page 96: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

CSRF + JavaScript/JSON[ ["ct","Alice","[email protected]"], ["ct","Bob","[email protected]"], ...]

var new_script = document.createElement(‘script’);

new_script.src = ‘http://google.com/addressbook’;

// override the Array constructorArray = new function() { ...};

document.head.appendChild(new_script);

http://jeremiahgrossman.blogspot.com/

Page 97: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

History Insecurity

• Links already visited are colored differently in a web browser.

• Javascript can introspect...

• More targeted phishing.

Page 98: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Timing Information Leakage

• Cached images are quick to load.

• Referencing a BankOfAmerica image and checking how long it takes to load.

• Referencing SCRIPTs on an intranet address and seeing how long they take to “time out” to effectively port scan.

Page 99: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Meanwhile... Mashups!

Page 100: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Hand over your Password!

Page 101: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Let me take over your web browser

Page 102: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

This is not a fluke.Mashups are the future.

How do we secure them?

Page 103: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Cross-Frame Messaging

Page 104: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Cross-Frame Messaginghttp://acme.com/article#paragraph_2

Page 105: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Cross-Frame Messaginghttp://acme.com/article#paragraph_2

http://acme.com/article#paragraph_3

Page 106: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Cross-Frame Messaginghttp://acme.com/article#paragraph_2

http://acme.com/article#paragraph_3

Page 107: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Idea #1:Expand “Platform”

Features of the Browser.

Page 108: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

• JSONRequesthttp://www.json.org/JSONRequest.html

• Cross-Document Messaginghttp://www.whatwg.org/specs/web-apps/current-work/#crossDocumentMessages

• MashupOS [JacksonWang2007]at HotOS2007.

Current Work

Page 109: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

• event announcementextract and send to Calendar of my choice (Google Cal, Yahoo Cal, 30Boxes, ...)

• login formauto-fill with credentials providedby some identity provider.

• “recommend” featureprompt to enter a name from address book.

Loosely Coupled Mashups

Page 110: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

3 Simple Proposals for Loosely Coupled Mashups

• Javascript Clean Slatemaking sure the API is not hijacked.

• Limited Extensionsextensions that awaken only when activated.

• Metadata-Driven Extensionsextensions that process onlymetadata-driven requests.

[Adida2007]

Page 111: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Idea #2:Security in the App Layer

Page 112: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

• Cache Cookies [JuelsJakobssonJagatic]using the cache to store secret tokens.

• Active Cookies [JuelsJakobssonStamm]using the cache to store Javascriptverification code.

• Subspace [JacksonWang]using tricks of subdomains to isolateJavascript code.

Page 113: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Secure Tokens in the Fragment Identifier

Page 114: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Secure Tokens in the Fragment Identifier

http://myfriendbook.com/resource#8cvb8234234

Page 115: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Secure Tokens in the Fragment Identifier

http://myfriendbook.com/resource#8cvb8234234

Not sent over the network.

Page 116: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Secure Tokens in the Fragment Identifier

http://myfriendbook.com/resource#8cvb8234234

Not sent over the network.

Does not cause a page reload.

Page 117: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Closing Thoughts

Page 118: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

• The web browser is a platform.

Closing Thoughts

Page 119: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

• The web browser is a platform.

• It needs cross-application features witha solid security model.

Closing Thoughts

Page 120: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

• The web browser is a platform.

• It needs cross-application features witha solid security model.

• There are still interesting tricks to pullbased on existing protocols and behaviors.

Closing Thoughts

Page 121: Web (2.0) Securityassets.adida.net/presentations/crcs-2007-04-18.pdf · web browsers in 1999 were dumb clients. web security was about protecting the server from a rogue client

Questions?

http://flickr.com/photos/hollywoodpoodle/373053089/