Same Origin Policies Hidetake Jo.

Slides:



Advertisements
Similar presentations
PHP Form and File Handling
Advertisements

CS193H: High Performance Web Sites Lecture 10: Rule 6 – Put Scripts at the Bottom Steve Souders Google
Nick Feamster CS 6262 Spring 2009
Protecting Browser State from Web Privacy Attacks Collin Jackson, Andrew Bortz, Dan Boneh, John Mitchell Stanford University.
Cross Site Scripting (XSS)
© 2009 IBM Corporation IBM Rational Application Security The Bank Job Utilizing XSS Vulnerabilities Adi Sharabani IBM Rational Application Security Research.
By Loukik Purohit & Rohit Ghatol
ForceHTTPS: Protecting High-Security Web Sites from Network Attacks Collin Jackson and Adam Barth.
The OWASP Foundation Web Application Security Host Apps Firewall Host Apps Database Host Web serverApp serverDB server Securing the.
CookiesPHPMay-2007 : [‹#›] Maintaining State in PHP Part I - Cookies.
Working with the Internet
Hands-on SQL Injection Attack and Defense HI-TEC July 21, 2013.
Attacking and defending Flash Applications. Flash Security I’ll talk about; o RIA, Web 2.0 and Security o What is Crossdomain.xml? Why does it exist?
Developing HTML5 Application using MVVM pattern Pekka Ylenius.
Web Server Programming
An Evaluation of the Google Chrome Extension Security Architecture
EECS 354 Network Security Cross Site Scripting (XSS)
Secure web browsers, malicious hardware, and hardware support for binary translation Sam King.
The Most Dangerous Code in the Browser Stefan Heule, Devon Rifkin, Alejandro Russo, Deian Stefan Stanford University, Chalmers University of Technology.
Configuring Windows Vista Security Chapter 3. IE7 Pop-up Blocker Pop-up Blocker prevents annoying and sometimes unsafe pop-ups from web sites Can block.
Introduction to Web Database Processing
ASP.NET 2.0 Chapter 6 Securing the ASP.NET Application.
Computer Security and Penetration Testing
Frame isolation and the same origin policy Collin Jackson CS 142 Winter 2009.
1 Subspace: Secure Cross Domain Communication for Web Mashups Collin Jackson and Helen J. Wang Mamadou H. Diallo.
Subspace: Secure Cross-Domain Communication for Web Mashups Collin Jackson Stanford University Helen J. Wang Microsoft Research ACM WWW, May, 2007 Presenter:
Subspace: Secure Cross-Domain Communication for Web Mashups In Proceedings of the 16th International World Wide Web Conference. (WWW), 2007 Collin Jackson,
Introduction to InfoSec – Recitation 10 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
PLUG INS flash, quicktime, java applets, etc. Browser Plug-ins Netscape wanted a method to extend features of the browser became an unofficial standard.
Principles of Computer Security: CompTIA Security + ® and Beyond, Third Edition © 2012 Principles of Computer Security: CompTIA Security+ ® and Beyond,
AJAX Without the “J” George Lawniczak. What is Ajax?
Web Application Access to Databases. Logistics Test 2: May 1 st (24 hours) Extra office hours: Friday 2:30 – 4:00 pm Tuesday May 5 th – you can review.
Securing Web Applications. IE 7 significantly reduced attack surface against the browser and local machine…
Web Browser Security Prepared By Mohammed EL-Batta Mohammed Soubih Supervised By Eng. Eman alajrami Explain Date 10. may University of Palestine.
Krishna Mohan Koyya Glarimy Technology Services
OMash: Enabling Secure Web Mashups via Object Abstractions Steven Crites, Francis Hsu, Hao Chen UC Davis.
OMash: Enabling Secure Web Mashups via Object Abstractions Steven Crites, Francis Hsu, Hao Chen (UC Davis) ACM Conference on Computer and Communications.
10/13/2015 ©2006 Scott Miller, University of Victoria 1 Content Serving Static vs. Dynamic Content Web Servers Server Flow Control Rev. 2.0.
CSCE 201 Web Browser Security Fall CSCE Farkas2 Web Evolution Web Evolution Past: Human usage – HTTP – Static Web pages (HTML) Current: Human.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
PLUG INS flash, quicktime, java applets, etc. Browser Plug-ins Netscape wanted a method to extend features of the browser became an unofficial standard.
Web Application with AJAX CS 526 advanced interned and Web system Presenters Faris Kateb Mohammed AbdulAziz Omar Alzahrani.
University of Central Florida The Postman Always Rings Twice: Attacking & Defending postMessage in HTML5 Websites Ankur Verma University of Central Florida,
Protecting Browsers from Extension Vulnerabilities Paper by: Adam Barth, Adrienne Porter Felt, Prateek Saxena at University of California, Berkeley and.
Implementing and Using the SIRWEB Interface Setup of the CGI script and web procfile Connecting to your database using HTML Retrieving data using the CGI.
Securing Angular Apps Brian Noyes
Shibboleth 1.2 Technical Overview “So you thought 1.1 was complicated…” Scott Cantor The Ohio State University and Internet2 Scott Cantor.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
Active X and Signed Applets Chad Bollard. Overview ActiveX  Security Features  Hidden Problems Signed Applets  Security Features  Security Problems.
The Postman Always Rings Twice: Attacking and Defending postMessage in HTML5 Websites Paper by Sooel Son and Vitaly Shmatikov, The University of Texas.
Windows Vista Configuration MCTS : Internet Explorer 7.0.
Technologies For Creating Rich Internet Applications Presenter's name
Web Security (cont.) 1. Referral issues r HTTP referer (originally referrer) – HTTP header that designates calling resource  Page on which a link is.
ArcGIS for Server Security: Advanced
Google’s Gruyere1 : An XSS Example Presented by: Terry Gregory
Building Secure ColdFusion Applications
Data Virtualization Tutorial… CORS and CIS
How P3P Works Lorrie Faith Cranor P3P Specification Working Group Chair AT&T Labs-Research 4 February
What is REST API ? A REST (Representational State Transfer) Server simply provides access to resources and the REST client accesses and presents the.
Cross-Site Request Forgeries: Exploitation and Prevention
Jon Peppler, Menlo Security Channels
Introduction to Silverlight
WEB API.
Windows Mobile 2003 For The Enterprise
What is Cookie? Cookie is small information stored in text file on user’s hard drive by web server. This information is later used by web browser to retrieve.
Implementing Client Security on Windows 2000 and Windows XP Level 150
Protecting Browsers from Extension Vulnerabilities
Cross-Site Scripting Attack (XSS)
Cross Site Request Forgery (CSRF)
Presentation transcript:

Same Origin Policies Hidetake Jo

What is it? A security policy for the web Access from http://www.example.com/dir/test.html Meant to prevent cross-site issues Evil.com can’t access content from bank.com Simple enough, right?

Not quite… SOP is implemented everywhere Browser features, RIA plugins, etc. SOP is implemented differently Neat but dangerous Makes web developers life very interesting

Agenda High level overview of.. Summary of deltas How this affects us Same Origin Policies by technology Browsers, Javascript, Cookies, RIA, etc Summary of deltas How this affects us Conclusion

Same Origin For Get/Post for Most Browsers Get/Post request can be made from one domain to another. Get/Post response can only be read under the following conditions: If the ports match on both sites. If the domain + subdomain match on both sites. Example.com Request * Example.com Response Example.com:80 Response Example.com:80 Response Example.com:100 Example.com Response Foo.Example.com Example.com Response Different.com

Same Origin For Get/Post Request for Browsers Exceptions If two different subdomains (different origin) is under the same domain.. And one is performing domain lowering. Clock.live.com vs Vulnerable.live.com Clock.live.com setting document.domain to live.com. Vulnerable.live.com is owned then attacker can set domain to live.com and access clock.live.com! Threats: All eggs in one basket (*.google.com or *.live.com). Cross-subdomain communication.

Risk Domain Lowering Cross-Site Request Forgery Putting all the eggs in one basket Cross-Site Request Forgery Netflix http://www.webappsec.org/lists/websecurity/archive/2006-10/msg00063.html Get/Post request for adding movie to queue Get/Post works cross-domain…

Script and XML Resources If you’re including or exposing resource cross-domain such as JSON, SCRIPT, etc Script Forfeit trust to site exposing the script resource XML/JSON Risk information disclosure if you’re exposing resource E.g. Read content of script, access JSON array, retrieve XML data. JSON: var data = { "social": "11-22-3333", "name": "Joe"}; XML: var data = <info><social>11-22-3333</social><name>Joe</name> Example.com Response Example.com:80 Response Example.com:80 Response Example.com:100 Example.com Response Foo.Example.com Example.com Response Different.com

Risk Javascript\XML Hijacking Exposed script contained contacts info Gmail http://jeremiahgrossman.blogspot.com/2006/01/advanced-web-attack-techniques-using.html Exposed script contained contacts info Script path was fully predictable Script can be included x-domain Script content can be accessed Variables Functions (e.g. function_name.toString() )

Same Origin for Cookies Cookies by default permit read/write access to cookie values if: The domain is the same (Limited subdomain check) Foo.bar.com  bar.com bar.com  foo.bar.com Does not respect port numbers! Does not respect scheme Unless you opt in to secure attribute Example.com Response Example.com:80 Response Example.com:80 Response Example.com:100 Example.com Response Foo.Example.com Example.com Response Different.com

Risk Foo.bar.com can steal/poison cookie on bar.com. Foo.bar.com:1111 can steal/poison cookie on Foo.bar.com:2222. With regards to cookie and subdomains and ports are of limited security boundary.

Same Origin for IE IE does not use ports during origin calculation. You can read/write/script between: Bar.com:80 and Bar.com:1234 Example.com Response Example.com:80 Response Example.com:80 Response Example.com:100 Example.com Response Foo.Example.com Example.com Response Different.com

Risk Hosting multiple web apps on different ports Should be avoided when possible Ports are not a security boundary for IE Host web apps on separate domains

Same Origin for XmlHTTPRequest You can not issue request cross-domain. You can only read response on the same domain. Most restrictive Same Origin Policy But it allows you to insert arbitrary header value when issuing request. (e.g. SOAPAction header) Example.com Request

Same Origin for XDomainRequest + COR Using declarative security Permits you to expand origin This is an opt-in policy/feature Access-Control-Allow-Origin/Method Header Allows you to send request cross-domain Allows you to read response cross-domain More Info: Cross Origin Resource Sharing (Firefox 3.5, Safari 4.0) http://www.w3.org/TR/access-control/ XDomainRequest Object (IE8) http://msdn.microsoft.com/en-us/library/cc288060(VS.85).aspx

Example\Risk Overly permissible policy Kind of like ACL on Windows. Tempting for frustrated developer to give everyone full control.

Same Origin for Flash/Silverlight Site where the binary lives is origin. Site where the binary is embedded is also considered origin in some cases. App.xap lives in foo.com and a page on bar.com is using it. App now has access to bar.com and foo.com. Read/Write DOM on bar.com Make network requests back to foo.com Lock these RIA runtimes down: Cross-domain policy files For Flash and Silverlight Easy to mess up: Tom found a major site that allowed all sites on the internet to read/write to their site for over a year.. Embed these applets with security flags. Silverlight: EnableHtmlAccess Flash AllowScriptAccess

Risk Hosting potentially evil RIA files Can make network connection back to your host Embedding potentially evil RIA files Can script on your site Hosting overly permissive policy files Can read and write against your domain

Same Origin for Flash/Silverlight Data Storage flash.net.SharedObject Capacity: 100KB by default (adjustable) Same Origin Policy By Domain By User 3rd Party Content (enabled by default) Silverlight System.IO.IsolatedStorage.IsolatedStorageFile Capacity: 1024KB By User + Assembly By User + Domain + Assembly

Same Origin for PostMessage API HTML 5 Feature Enables cross-domain Communication target.postMessage(msg, origin) Can implemenet listener by calling target.attachEvent(“onmessage” , handler) target.addEventListener(“message”, handler, useCapture) Origin check in handler optional

Risk Lack of optional origin check Trusting potentially malicious origin If no origin check is done by design Sanitize incoming message before use

Same Origin for Put/Delete In addition to Get/Post there is Put/Delete support for forms in HTML 5 Html 5 Spec supports this via form Hopefully this will not be allowed x-domain!

Same Origin for WebSockets Html 5 Feature Enables bi-directional binary/text comm. Still unclear how it will be secured Enable cross-domain communication.

Same Origin for ActiveX Up to dev/test/pm to define the policy. Red flag! Sitelock technique Contain usage to one domain. (Different from SOP) Generally should follow the same-origin policy… But which one??? The strictest definition to be safest. Port, Domain, Subdomain, Protocol should match for read/write access.

Summary My attempt at a summary table…

Different policies = Trouble Cross-domain Get/Post can introduce CSRF. Incorrectly configured RIA policy files and apps can introduce cross-site access. Lenient subdomain rule for cookie access makes hosting multiple sites a challenge. Cross-domain resource sharing of script, json, xml, etc can introduce hijacking problems. IE doesn’t utilize port for origin calculation. Web apps should be hosted on distinct domains. One-off x-domain apis such as postmessage can catch developers off guard. Etc..

How does this impact us? We’re in a bad state with varying definition for same-origin policy. Hard for developers to understand the risk with their design. Audit all the areas that can go wrong: Webservices that return includable data. New ActiveX controls. Features that leverage RIA platforms. Crossdomain policy files Declarative security flags Usage of apis that permit x-domain access by design Web service that permits state changing operations Topology of the web app setup. Etc.

Conclusion There are other other technology that needs to be looked at: Gears, Air, Java, HTML 5 features, etc. Same-origin policy is inconsistent today. It will probably continue to stay this way. For compat reasons… The same-origin policy will probably evolve. Hence the definition in this deck may be obsolete soon.

Questions If you have questions, concerns, corrections please mail me at: hidejo@gmail.com