2008/12/121 dynamic pharming attacks and locked same-origin policies for web browsers chris karlof,...

43
2008/12/12 1 Dynamic Pharming Attac ks and Locked Same-ori gin Policies for Web B rowsers Chris Karlof, J.D. Tygar, and D avid Wagner, UC Berkeley, USA; Umesh Shankar, Google, Inc., USA, 14th ACM Conference on Computer and Communications Security, 2007

Upload: meghan-burns

Post on 13-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 1

Dynamic Pharming Attacks and Locked Same-origin Pol

icies for Web Browsers

Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA;

Umesh Shankar, Google, Inc., USA,

14th ACM Conference on Computer and Communications Security, 2007

Page 2: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 2

Outline

Introduction Preliminaries Dynamic Pharming Attacks The Locked Same-origin Policy Related Work Conclusion and Comments

Page 3: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 3

Introduction (1/3)

Phishing Social engineering attack in which an adversary lures an u

nsuspecting Internet user to web site posing as a trustworthy business with which the user has a relationship

Pharming The adversary subverts the domain-name lookup system(D

NS) DNS queries for the victim site’s domain (say, google.com)

return an attacker-controlled IP address Via DNS cache poisoning and DNS response forgery

Page 4: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 4

Introduction (2/3) DNS cache poisoning

A maliciously created or unintended situation that provides data to a Domain Name Server that did not originate from authoritative DNS sources

Predict what hostname would be requested and to which authoritative DNS server this request was destined

Send forged response to the caching DNS server DNS response forgery

A special 16-bit field called transaction ID Generates predictable sequence IDs with a fixed increment

which is same for all child processes An attacker can exploit this vulnerability to spoof DNS

responses

Page 5: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 5

Introduction (3/3)

Describe a new type of DNS attack against web authentication we call dynamic pharming

Dynamic pharming takes advantage of how browsers currently implement the same-origin policy

Propose two locked same-origin policies which enforce access control for web objects retrieved over SSL by using servers’ public keys and X.509 certificates.

Page 6: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 6

Outline

Introduction Preliminaries

Threat Models The Legacy Same-origin Policy Secure Sockets Layers (SSL) and X.509 certificates

Dynamic Pharming Attacks The Locked Same-origin Policy Related Work Conclusion and Comments

Page 7: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 7

Threat Models(1/3)

Phishers - no capabilities are needed beyond control of a single internet node Complete control over some web server with a pu

blic IP address Send communications such as emails and instant

messages to potential victims Effect application-layer man-in-the-middle atta

cks, representing a legitimate server to the victim and proxying input from the victim to the real server as needed

Page 8: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh
Page 9: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 9

Threat Models(2/3)

Pharmers - An attacker with pharming capability has all the abilities of a phisher, plus The ability to change DNS records for the target

site, such that the victim will resolve the target site’s name to the attacker’s IP address

through DNS poisoning, spoofed DNS responses, or by tricking a user to modify her DNS settings

Page 10: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 10

Threat Models(3/3)

Active Attackers - the most powerful threat considered here. In addition to pharming capability: Control the internet routing infrastructure and can

re-route traffic destined to particular IP addresses Eavesdrop on all traffic Mount active, network-layer, man-in-the-middle att

acks

Page 11: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 11

The Legacy Same-origin Policy (SOP) The SOP in web browsers governs access control a

mong different web objects and prohibits a web object from one origin from accessing web objects from a different origin HTTP cookies, HTML images, Javascript, CSS files, XML fi

les, etc Consider two objects to have the same origin if the o

riginating host, port, and protocol are the same for both web objects http://www.foo.com/index.html http://www.foo.com/other.html https://www.foo.com/secure.html (different protocol) http://www.xyz.com/index.htm (different host)

Page 12: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 12

Secure Sockets Layers (SSL) and X.509 certificates (1/5)

SSL Cryptographic protocols for establishing end-to-en

d secure channels for Internet traffic Uses X.509 certificates to identify the server parti

cipating in the SSL connection

Page 13: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 13

Secure Sockets Layers (SSL) and X.509 certificates (2/5)

X.509 certificate Server’s public key Domain name of the web site (specified in the CN

subfield of the certificate) Public key of the issuer of the certificate Time period for which the certificate is valid The issuer’s signature over these fields

Page 14: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 14

Secure Sockets Layers (SSL) and X.509 certificates (3/5) When the client’s web browser makes a connection to an SSL en

abled web server over HTTPS, the browser must verify the server’s certificate is valid Verify that the first certificate in the chain is from a trus

ted CA Verify that (a) every certificate in the chain has a valid

signature from its predecessor, using the public key of the predecessor and (b) that no certificate has

expired. Verify that the CN field of the last certificate in the chai

n matches the domain name of the web site the browser intended to visit

Page 15: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 15

Secure Sockets Layers (SSL) and X.509 certificates (4/5)

If any of these checks fail, the browser warns the user. If the user chooses to continue, the user may permit the SSL connection to continue even though any or all of these checks have failed to ensure compatibility with misconfigured certificates and

SSL servers approximately 63% of SSL certificates have such problems allows web sites to use self-signed certificates if they choos

e, instead of paying a CA for a certificate.

Page 16: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 16

Secure Sockets Layers (SSL) and X.509 certificates (5/5)

After the browser validates the server’s certificate, it participates in a cryptographic protocol with the server where

1. the server proves knowledge of the private key corresponding to the public key in the certificate

2. they negotiate a session key to encrypt and authenticate subsequent traffic between them

if there are any errors in this protocol, the browser closes the connection with no chance of user override

Page 17: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 17

Outline

Introduction Preliminaries Dynamic Pharming Attacks

Defeating DNS pinning The Locked Same-origin Policy Related Work Conclusion and Comments

Page 18: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 18

Dynamic Pharming Attacks(1/5)

Suppose the pharmer can control the results of DNS queries for www.vanguard.com

We assume users’ machines have been initialized with client-side SSL certificates, and www.vanguard.com knows the public keys of its users’ certificates

Page 19: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 19

Dynamic Pharming Attacks(2/5)

If the server certificate is not signed by one of the trusted CAs in the browser or the certificate’s CN does not match the server’s domain (i.e., www.vanguard.com), the browser will warn the user and ask her if it is safe to proceed.

If the user accepts the pharmer’s certificate, Alice’s browser will establish an SSL connection to the pharmer at 6.6.6.6 and request index.html

Page 20: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 20

Dynamic Pharming Attacks(3/5) After the pharmer returns the trojan document to Alice, it

updates the DNS entry for www.vanguard.com to the IP address of the legitimate server for www.vanguard.com, say 1.2.3.4.

This forces the browser to load the legitimate https://www.vanguard.com/index.html document into the <iframe> and display it to the user

Page 21: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 21

Dynamic Pharming Attacks(4/5)

After authentication completes The outer document and the <iframe> both have t

he same domain (www.vanguard.com) and same protocol (https), the SOP will allow the malicious Javascript running in the outer document to access the content in the <iframe>

The malicious Javascript takes control and monitors the user’s interactions in the <iframe> with the legitimate server for www.vanguard.com

Page 22: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh
Page 23: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 23

Dynamic Pharming Attacks(5/5)

The trojan effectively hijacks control of Alice’s session can eavesdrop on sensitive content forge transactions sniff secondary passwords

Can be used to compromise even the strongest web authentication schemes currently known, including passwords, authentication cookies, and client-side SSL

Page 24: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 24

Defeating DNS Pinning

DNS pinning Web browser caches the result of a DNS query for a fixed

period of time, regardless of the DNS entry’s specified lifetime

Implemented to defend against “DNS rebinding” attacks Pharmer can force a victim to renew its DNS entry fo

r a given domain on demand by rejecting connections from the victim. The browser reacts by refreshing its DNS entry for the domain (by Martin Johns, Aug. 2006)

Page 25: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 25

Attempt to contact the pharmer, fail, refresh its DNS entry, receive the IP address of the legitimate server, and load the legitimate index.html document into the <iframe>

Page 26: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 26

Outline Introduction Preliminaries Dynamic Pharming Attacks The Locked Same-origin Policy

The Weak Locked Same-origin Policy The Strong Locked Same-origin Policy Security Analysis Deployability Analysis Support for Sub-domain Object Sharing

Related Work Conclusion and Comments

Page 27: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 27

The Locked Same-origin Policy (1/2)

Since dynamic pharming hijacks a user’s session after initial authentication completes, it is unlikely any future web authentication protocol developed for currently deployed browsers will resist dynamic pharming either

we must upgrade the browser’s same-origin policy Two locked same-origin policy Enforce access control for web objects retrieved over SSL

(locked web objects) by using servers’ public keys and X.509 certificates

Page 28: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 28

The Locked Same-origin Policy (2/2)

the weak locked same-origin policy isolates a domain’s locked web objects with valid certificate

chains from objects with invalid chains. This enables browsers to distinguish a legitimate server using a valid certificate from pharmers using invalid certificates

the strong locked same-origin policy enforces access control using cryptographic identity, namel

y web sites’ public SSL keys. The browser compares the public keys it associates with locked web objects; access in granted only if they match

Page 29: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 29

The Weak Locked Same-origin Policy

Tag each locked web object with a validity bit whether the certificate chain corresponding to the SSL

connection over which the object was retrieved contained any errors (e.g., self-signed certificate, CN/domain mismatch)

the browser allows a locked web object to access another locked web object if and only if 1) the legacy SOP would allow access and 2) the validity bits match

Page 30: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 30

The Strong Locked Same-origin Policy

Tag each locked web object with the public key of the other endpoint of the SSL connection (i.e., the web server).

The browser allows a locked web object to access another locked web object if and only if 1) the legacy SOP would allow access and 2) the associated public keys match

Page 31: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 31

Security Analysis (1/3)

the weak locked same-origin policy If a web server hosting domain D (i.e., the target domain) u

ses a valid X.509 certificate signed by a trusted root CA

Resists phishing attacks a phisher has a different domain name

For pharming and active attacks can have the same name as the target domain if not having a valid certificate for the target domain, the vali

dity bit will be false, while the validity bit of the web server’s locked objects will be true

Page 32: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 32

Security Analysis (2/3)

the strong locked same-origin policy If a web server hosting domain D uses an X.509 certificate

with public key PK

Resists phishing attacks a phisher has a different domain name

For pharming and active attacks The adversary must pharm D and also arrange for its own o

bjects to be tagged with PK 1) the adversary presents a X.509 certificate with PK, and 2) the browser and adversary can successfully establish an SSL c

onnection.

Page 33: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 33

Security Analysis (3/3)

If the adversary tries to present a certificate for PK and she does not know the private key corresponding to PK, she will not be able to successfully complete the SSL handshake

The browser will only tag the adversary’s locked web objects with a public key different from PK

Page 34: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 34

Comparison

Both the weak locked SOP and the strong locked SOP do not depend on users correctly answering prompts in response to certificate

Strong locked SOP does not require a web site to trust root CAs not to issue certificates to unauthorized parties for its domain. Enforcement relies only on servers’ public keys

Page 35: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 35

Deployablity Analysis

Constructed a sample of SSL servers by first crawling the web and then added the domain in the HTTPS link to the sample

Restricted to the following top-level domains: com, org, net, gov, edu, biz, info, and name. And excluded international top-level domains.

Found 14651 fully qualified SSL domains from 6192 second-level domains roughly 6.5% of the number of SSL domains Found 1464 domain names that resolved to multiple IP addresse

s For each of these domains, we established an SSL connection to

each of the domain’s servers and recorded each server’s certificate chain and public key

Page 36: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 36

Evaluation Results (1/2)

the weak locked same-origin policy Counted the number of domains which had server

s with both valid and invalid certificate chains found 8 such domains

can safely deploy the weak locked SOP in a way which requires minor browser changes, but does not require changes to the HTTP specification, SSL, or web servers

Page 37: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 37

Evaluation Results (2/2)

the Strong locked same-origin policy counted the number of fully qualified SSL domain

s with multiple servers that do not use the same public key on all of the servers found 83 such domains

These servers are not necessarily misconfigured, so browser developers cannot work with the domain’s administrators to “fix” the problem

Policy files for supporting multiple keys and key updates

Page 38: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 38

Page 39: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 39

Support for Sub-domain Object Sharing (1/2)

A web site might be composed of several domain names mail.xyz.com,www.xyz.com, login.xyz.com

The legacy SOP supports some exceptions which enable these sites to share information among sub-domains through certain web objects A user might authenticate herself to the server for login.xyz.

com This server will set a domain cookie with domain=xyz.com

for authenticating the user to the other subdomain servers The user’s browser will allow any sub-domain of xyz.com to

access this cookie

Page 40: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 40

Support for Sub-domain Object Sharing (2/2)

Domain cookies are vulnerable to pharming attacks If an adversary pharms any host name in

xyz.com, she can steal users’ domain authentication cookies for xyz.com

The site simply adds the servers’ public keys to its policy files and we extend the strong locked SOP

Page 41: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

Locked web objects: objects retrieved over SSL Shared locked web objects: objects retrieved over SSL whic

h are intended to be shared among sub-domains of a higher-level domain (e.g., domain cookies)

Untrusted certs: a legitimate server using a self-signed certificate or a certificate issued by a root CA untrusted by browsers

Page 42: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 42

Related Work Several researchers and security vendors have dev

eloped browser extensions, use a blacklist to help identify known phishing sites, or establish trusted paths with sites users have a relationship with

The locked SOP was inspired by the concept of Key Continuity Management (KCM), a model for key management

Jackson et al. present a excellent analysis of DNS rebinding vulnerabilities, including issues with Flash, Java, VPNs, caching, and proxies

“Protecting Browsers from DNS Rebinding Attacks”. In 14th ACM CCS ’07

Page 43: 2008/12/121 Dynamic Pharming Attacks and Locked Same-origin Policies for Web Browsers Chris Karlof, J.D. Tygar, and David Wagner, UC Berkeley, USA; Umesh

2008/12/12 43

Conclusion and Comments DNS vulnerabilities are hard to prevent from by nor

mal users Demonstrated how adversaries can use dynamic ph

arming attacks to hijack users’ authenticated web sessions, irrespective of the authentication mechanism

Evaluated the security and deployability of these approaches and showed how browsers can deploy these policies today to substantially increase their resistance to pharming attacks

Provide both a solid and necessary foundation for developing pharming resistant authentication