Know thyself
This presentation is the property of its rightful owner.
Sponsored Links
1 / 29

Know Thyself PowerPoint PPT Presentation


  • 82 Views
  • Uploaded on
  • Presentation posted in: General

Know Thyself. Dieter Gollmann Hamburg University of Technology Germany. Thesis. To enforce (same) origin policies, you have to be able to authenticate origin. Even when you are unable to authenticate the origin of inputs provided by others, you may still be able to authenticate your own.

Download Presentation

Know Thyself

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Know thyself

Know Thyself

Dieter Gollmann

Hamburg University of Technology

Germany


Thesis

Thesis

  • To enforce (same) origin policies, you have to be able to authenticate origin.

  • Even when you are unable to authenticate the origin of inputs provided by others, you may still be able to authenticate your own.

  • Can we use an elementary security primitive “Recognizing yourself”?


Owls to owasp

Owls to OWASP

  • Web application vulnerabilities like XSS or XSRF are a major security concern today.

  • Is there something to be learned from security mechanisms developed for mobile systems?


Cross site scripting

page with malicious instructions

Cross-site Scripting

Page

with

instr.

Page

with

instr.

Form

with

[instr.]

trusted zone

Form

with

[instr.]

Stored XSS

Reflected XSS

firewall

Malicious instructions encoded as data

attacker.com

untrusted zone


Know thyself

authenticated

tunnel

user

target system

form

with

instr.

firewall

form with malicious instructions

attacker.com

untrusted zone

XSRF


Cross site scripting xss

Cross-site scripting (XSS)

  • Parties involved: Attacker, client (victim), server (‘trusted’ by client).

  • Attacker places malware on a page at server (stored XSS) or gets victim to include attacker’s code in a request to the server (reflected XSS).

  • Malware contained in page returned by server to client; executed at client with permissions of the trusted server.

  • Violation of an origin based security policy.


Xsrf attack

XSRF attack

  • Parties involved: Attacker, user, target website (victim).

  • User authenticated at target (cookie, SSL session,…).

  • User has to visit the attacker’s webpage that contains hidden malware, e.g. in an HTML form.

  • When the user browses this page, it automatically submits the malware to a target site where the user has access.

  • Target authenticates request as coming from user; form data accepted since it comes from a legitimate user.

  • Evades target’s origin based security policy.


Causes defences

Causes & Defences

  • Ultimate cause of XSS attack: The client only authenticates ‘the last hop’ of the entire page, but not the true origin of all parts of the page.

  • Ultimate cause of XSRF attack: The server only authenticates ‘the last hop’ of the entire page, but not the true origin of all parts of the page.

  • Defence 1: Do not rely on origin based policies; differentiate between code and data instead.

  • Defence 2: Authenticate your own requests.


Defence 1

Defence 1

  • Filter client inputs, sanitize server outputs, escape dangerous characters.

  • Do you know all paths malicious code can arrive?

    • DOM-based XSS!

  • Do you know how filtered input is processed further?

    • Will a helpful component change くor ‹  to <?

  • Do you know about all interactions between different layers of abstraction?

    • Addslashes and the GBK character set (simplified Chinese):

    • 0xbf27  0xbf5c27 (0x27 encodes ‘ )

    • Chris Shiflett: http://shiflett.org/blog/2006/jan/addslashes-versus-mysql-real-escape-string


Interlude mobile ipv6

Interlude – Mobile IPv6


Mipv6 security rfc 3775

MIPv6 Security (RFC 3775)

  • Mobile node has secure tunnel to home agent where it as a home address.

  • Mobile node moves and informs correspondent node about its new care-of-address address.

  • Correspondent node updates its binding cache.

  • A malicious (mobile) node may lie about its location; e.g. to launch a bombing attack.

  • Secure binding update with return routability: Challenges sent to identity and location, response binds identity to location.

  • Cryptographic keys are sent in the clear!


Binding update protocol

Binding update protocol

[RFC 3775]

Challenge sent to home address

HoTI

home

CN

HoT: K0, i

Challenge sent to location

CoTI

binds home address to location

CoT: K1, j

MN

3: MAC(Kbm;CoA, CN, BU)


Bu protocol

BU Protocol

  • Mobile sends two BU init messages to the correspondent, one via the home agent, the other on the direct link.

  • Correspondent constructs a key for each of the two BU init messages, returns these keys K0and K1independently to mobile.

  • Binding key Kbm = SHA-1(K0,K1) used by mobile to authenticate the binding update; authentication binds location (care-of-address) to identity (home address).


Ownership of addresses

Ownership of addresses

  • Dynamic address allocation schemes checks that a new address is still free: broadcasts query asking whether any node on the network already uses this address.

  • Squatting attack: Attacker falsely claims to have the address that should be allocated; prevents victim from obtaining an address in the network.

  • Can a node prove that it “owns” an IP address without relying on third party (home agent, CA)?

  • Use public key cryptography without an PKI.


Cga cryptographically generated addresses

CGA: Cryptographically Generated Addresses

  • Address owner creates a public key/ private key pair; hash of the public key as interface ID in an IPv6 address.

  • Mobile node signs BU information with its private key; sends the signed BU together with its public key to the correspondent.

  • Correspondent checks that the public verification key is linked to the IP address.

  • Address is “certificate” for its public key.


Cryptographically generated addresses basic idea

private key

public key

hash

interface ID

subnet prefix

two reserved bits

Cryptographically Generated Addresses (basic idea)


Back to web applications

Back to Web applications


Authenticating origin

Authenticating origin

  • Authentication: “Know whom you are talking to.”

  • Bad definition: Computers do not talk; too narrow generalization from communications security.

  • Better: Authentication binds different elements in an IT system, e.g. identity and location.

  • Web applications: Bind parts of a page to their origin.

  • This may be difficult, and may not be necessary.

  • Know thyself: Recognize the parts you have contributed.

  • Identification: Recognize those parts that come from the same source.

  • Pekka Nikander: identidem = same as before


Authentication in web applications

Authentication in Web applications

  • XSS defence: Server sends unpredictable one-time URLs to the client during session establishment; server can recognize these URLs as ‘its own’ and can authenticate requests as originating directly from the client.

    • One-time URLs have to be stored in a safe place at the client.

    • Source: Martin Johns: SessionSafe

  • Server initiated XSRF defence: Authenticate requests at level of the Web application (‘above’ the browser); application sends authenticators with each action:

    • XSRFPreventionToken, e.g. HMAC(Action_Name+Secret, SessionID);

    • Random XSRFPreventionToken or random session cookie.


Authentication in web applications1

Authentication in Web applications

  • Client-side only XSRF defence for HTTP layer sessions :

  • Proxy between browser and network marks all URLs in incoming web pages with unpredictable token; keeps database associating tokens with domains.

  • Proxy checks all outgoing requests:

    • Know thyself: If a token is found, the request did not originate in the client.

    • Identification: Proxy then checks whether its origin matches the domain the request is sent to.

    • Otherwise, all authenticators (SIDs, cookies) added by the browser are stripped from the URL.

  • Source: Martin Johns, RequestRodeo.


Dns rebinding

DNS rebinding


Dns rebinding1

DNS rebinding

  • Web browsers enforce same origin policy: Applet can only connect back to the server it was downloaded from.

  • To make a connection, the client’s browser needs the IP address of the server.

  • Authoritative DNS server resolves ‘abstract’ DNS names in its domain to ‘concrete’ IP addresses.

  • Client’s browser ‘trusts’ the DNS server when enforcing the same origin policy.


Know thyself

Trust is Bad for Security!


Dns rebinding attack

DNS rebinding attack

  • “Abuse trust”: Attacker creates attacker.org domain; binds this name to two IP addresses, to its own and to the target’s address.

  • Client downloads applet from attacker.org; applet connects to target; permitted by same origin policy.

  • Defence: Same origin policy using IP address

    • D. Dean, E.W. Felten, D.S. Wallach: Java security: from HotJava to Netscape and beyond, 1996 IEEE Symposium on Security & Privacy.


Dns rebinding attack1

DNS rebinding attack

  • Next round: Javascript, 2001.

  • Client visits attacker.org; attacker’s DNS server resolves this name to attacker’s IP address with short time-to-live.

  • Attacker rebinds attacker.org to target’s address.

  • Malicious script connects to attacker.org, which now is resolved to the target’s address.

  • Defence: Do not trust server on time-to-live; keep time yourself and pin host name to original IP address.

    • J. Roskind: Attacks against the Netscape browser. in RSA Conference, April 2001.


Dns rebinding attack2

DNS rebinding attack

  • Next round: Browser plug-ins that do their own pinning.

  • More sophisticated authorisation system: Client browser refers to policy obtained from DNS server when deciding on connection requests.

  • Dangerous constellation:

    • Communication path between plug-ins.

    • Each plug-in has its own pinning database.


Dns rebinding attack3

DNS rebinding attack

  • Attacker may use the client’s browser as a proxy to attack the target.

  • Defence: Centralize security controls; one pinning database for all plug-ins; e.g., let all plug-ins use the browser’s pins.

  • Defence: Do not ask DNS server for the policy but the system with the IP address a DNS name is being resolved to.

    • Similar to reverse DNS lookup.

    • Similar to defences against bombing attacks.


Conclusions

Conclusions

  • You cannot enforce a security policy if you cannot authenticate the attributes it refers to.

  • Challenge: With origin based policies, how to authenticate the location a data item came from? It might have travelled a long way.

  • Which end point is being authenticated? Terms like ‘the server’ or ‘the client’ are too imprecise.

  • Challenge: How to authenticate location without a suitable infrastructure?

    • Know thyself and double check?


What to look out for

What to look out for?

  • Mashups, web feeds, and syndications.

  • With same origin policies the fun is just starting.

    • HTTP access control headers for cross-domain policies.

    • AJAX cross-domain policies.

  • Who will set those policies?

  • Who will enforce those policies?

  • Who can authenticate their attributes?


  • Login