Protecting Browsers from Cross-Origin CSS Attacks Lin-Shung Huang, Zack Weinberg Carnegie Mellon University Chris Evans Google Collin Jackson Carnegie.

Slides:



Advertisements
Similar presentations
Cross-Site Scripting Issues and Defenses Ed Skoudis Predictive Systems © 2002, Predictive Systems.
Advertisements

Nick Feamster CS 6262 Spring 2009
Protecting Browser State from Web Privacy Attacks Collin Jackson, Andrew Bortz, Dan Boneh, John Mitchell Stanford University.
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.
Lecture 6/2/12. Forms and PHP The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input When dealing with HTML forms.
Building web applications on top of encrypted data using Mylar Presented by Tenglu Liang Tai Liu.
17 th ACM CCS (October, 2010).  Introduction  Threat Model  Cross-Origin CSS Attacks  Example Attacks  Defenses  Experiment  Related Work 2 A Presentation.
Mitigating Malware Collin Jackson CS142 – Winter 2009.
EECS 354 Network Security Cross Site Scripting (XSS)
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Blackbox Reversing of XSS Filters Alexander Sotirov ekoparty 2008.
IS 360 Course Introduction. Slide 2 What you will Learn (1) The role of Web servers and clients How to create HTML, XHTML, and HTML 5 pages suitable for.
Chapter 9 Web Applications. Web Applications are public and available to the entire world. Easy access to the application means also easy access for malicious.
WHAT IS AJAX? Zack Sheppard [zts2101] WHIM April 19, 2011.
Web Privacy Topics Andy Zeigler Senior Program Manager, Internet Explorer Microsoft.
Happy Hacking HTML5! Group members: Dongyang Zhang Wei Liu Weizhou He Yutong Wei Yuxin Zhu.
Chapter 2 Introduction to HTML5 Internet & World Wide Web How to Program, 5/e Copyright © Pearson, Inc All Rights Reserved.
Introduction to InfoSec – Recitation 10 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
D ATABASE S ECURITY Proposed by Abdulrahman Aldekhelallah University of Scranton – CS521 Spring2015.
Presented by…. Group 2 1. Programming language 2Introduction.
Workshop 3 Web Application Security Li Weichao March
Origins, Cookies and Security – Oh My! John Kemp, Nokia Mobile Solutions.
Prevent Cross-Site Scripting (XSS) attack
CSCI 6962: Server-side Design and Programming Secure Web Programming.
Ladd Van Tol Senior Software Engineer Security on the Web Part One - Vulnerabilities.
Chapter 9 Web Applications. Web Applications are public and available to the entire world. Easy access to the application means also easy access for malicious.
Robust Defenses for Cross-Site Request Forgery CS6V Presented by Saravana M Subramanian.
JavaScript, Fourth Edition
November 13, 2008 Ohio Information Security Forum Attack Surface of Web Applications James Walden Northern Kentucky University
Chapter 8 Cookies And Security JavaScript, Third Edition.
Srikar Nadipally. Outline Finding and Exploiting XSS Vulnerabilities Standard Reflected XSS Stored XSS DOM based XSS Prevention of XSS attack Reflect.
Security Scanners Mark Shtern. Popular attack targets Web – Web platform – Web application Windows OS Mac OS Linux OS Smartphone.
Top Five Web Application Vulnerabilities Vebjørn Moen Selmersenteret/NoWires.org Norsk Kryptoseminar Trondheim
Robust Defenses for Cross-Site Request Forgery
Web Design (1) Terminology. Coding ‘languages’ (1) HTML - Hypertext Markup Language - describes the content of a web page CSS - Cascading Style Sheets.
October 3, 2008IMI Security Symposium Application Security through a Hacker’s Eyes James Walden Northern Kentucky University
By Sean Rose and Erik Hazzard.  SQL Injection is a technique that exploits security weaknesses of the database layer of an application in order to gain.
1 Robust Defenses for Cross-Site Request Forgery Adam Barth, Collin Jackson, John C. Mitchell Stanford University 15th ACM CCS.
Protecting Browsers from DNS Rebinding Attacks Collin Jackson, Adam Barth, Andrew Bortz ACM CCS Systems Modeling & Simulation Lab. Kim.
THE DEVIL IS IN THE (IMPLEMENTATION) DETAILS: AN EMPIRICAL ANALYSIS OF OAUTH SSO SYSTEMS SAN-TSAI SUN & KONSTANTIN BEZNOSOV PRESENTED BY: NAZISH KHAN COMPSCI.
University of Central Florida The Postman Always Rings Twice: Attacking & Defending postMessage in HTML5 Websites Ankur Verma University of Central Florida,
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
Protecting Browsers from Extension Vulnerabilities Paper by: Adam Barth, Adrienne Porter Felt, Prateek Saxena at University of California, Berkeley and.
Safe browsing - is an ad-blocker extension enough? AIMILIOS TSOUVELEKAKIS IT-DI-CSO IT LIGHTNING TALK – 12/
Cross-site request forgery Collin Jackson CS 142 Winter 2009.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
ACM Conference on Computer and Communications Security 2006 Puppetnet: Misusing web browsers as a distributed attack infrastructure Network Seminar Presenter:
Automatic and Precise Client-Side Protection against CSRF Attacks.
1 Utkarsha MishraCOMPSCI 725 David Silver, Suman Jana, Eric Chen, Collin Jackson, and Dan Boneh. “Password Managers: Attacks and Defenses.” In Proceedings.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
Carrie Estes Collin Donaldson.  Zero day attacks  “zero day”  Web application attacks  Signing up for a class  Hardening the web server  Enhancing.
The Postman Always Rings Twice: Attacking and Defending postMessage in HTML5 Websites Paper by Sooel Son and Vitaly Shmatikov, The University of Texas.
Redmond Protocols Plugfest 2016 Tarun Chopra Accessing APIs through Add-Ins Sr. Escalation Engineer.
Some from Chapter 11.9 – “Web” 4 th edition and SY306 Web and Databases for Cyber Operations Cookies and.
SlideSet #20: Input Validation and Cross-site Scripting Attacks (XSS) SY306 Web and Databases for Cyber Operations.
Building Secure ColdFusion Applications
An Introduction to Web Application Security
TMG Client Protection 6NPS – Session 7.
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
World Wide Web policy.
CISC103 Web Development Basics: Web site:
SQL Injection.
Web Systems Development (CSC-215)
Cross-Site Request Forgery (CSRF) Attack Lab
Cross Site Request Forgery New Attacks and Defenses
Cross-Site Scripting Issues and Defenses Ed Skoudis Predictive Systems
Client-Server Model: Requesting a Web Page
Exploring DOM-Based Cross Site Attacks
Cross Site Request Forgery (CSRF)
Presentation transcript:

Protecting Browsers from Cross-Origin CSS Attacks Lin-Shung Huang, Zack Weinberg Carnegie Mellon University Chris Evans Google Collin Jackson Carnegie Mellon University 17th ACM CCS (October, 2010) Hitesh Kumar Abhinav Choudhary

Outline Introduction Threat Model Cross-Origin CSS Attacks Example Attacks Defenses Experiment

Introduction Web-hosted applications have supplanted traditional desktop applications for almost everything that requires network communication.

Same-Origin Policy The same-origin policy is the basic principle used to secure Web applications from each other.

A Web Page Contains… Content o HTML Behavior o JavaScript Appearance o Cascading Style Sheet

Error-Tolerant Parsing To allow future extensibility, the CSS specification mandates error-tolerant parsing. This leads to a security hole. o GreyMagic Security Advisory GM#004-IE (2002) o To date, all published attacks of this type have required JavaScript, and most have been specific to Internet Explorer.

Threat Model Attacker Abilities o Sending and receiving arbitrary network traffic from its own servers. Target Behavior o Attacker’s Inject strings must pass server-side cross-site scripting (XSS) filters such as HTML Purifier. Victim Behavior o The web attacker can entice the victim into visiting its site.

Cross-Origin CSS Attacks Cross-origin CSS attacks are possible because of existing browser behaviors, reasonable taken in isolation, but with unexpected interactions.

Browser Behavior Session Authentication o Once a user has logged into a web application, their browser will transmit a credential with every HTTP request to that server.

Browser Behavior Cross-Origin Content Inclusion o Requests for cross-origin resources transmit any credentials associated with the site that hosts the resource, not credentials associated with the site whose page made the reference.

Browser Behavior Error-Tolerant Style Sheet Parsing o When browsers encounter syntax errors in CSS, they discard the current syntactic construct, skip ahead until what appears to be the beginning of the next one. CSS parsing mode o Quirks mode o Strict/standards mode

Browser Behavior Principles of error-tolerant style sheet parsing o Even while skipping, parentheses, square brackets, and curly braces must be properly balanced and nested. o The next syntactic construct might begin after the next semicolon, after going up one brace level, or after the next brace-enclosed block. o The end of a style sheet closes all open constructs without error.

Attack Steps In a cross-origin CSS attack, the attacker injects strings into the target document that bracket the data to be stolen.

CSS String Injection

Cross-Origin CSS Import When the victim user visits attacker.com url(

Confidential Data Extraction

Attack Limitations Insufficient Injection points o The attacker must inject two strings into the document containing the secret. Quotes o If the secret contains both types of quotes, or the attacker cannot predict which type of quotes it will contain, the attack may fail.

Attack Limitations Line Breaks o Internet Explorer permits unescaped line breaks in CSS string constants and url()s. Character Escapes Forcing UTF-7 o o {}#f{font-family:+ACI-

Attack Limitations Forcing UTF-7 o o {}#f{font-family:+ACI-

Example Attacks The Internet Movie Database (IMDb) o allows registered users to rate films, make posts on message boards, and send private messages to each other.

IMDb Example

Yahoo! Mail Example Send an to the victim with the subject line: ');} Wait for some time while the victim receives other messages. Send another to the victim with the subject line: {}body{background-image:url(‘ Induce the victim to visit attacker.com while signed into Yahoo! Mail. The attacking page is as follows

Yahoo! Mail Example

Defenses Content Type Enforcement Proposal o HTTP header Content-Type: text/css Content-Type: text/html o Strict Enforcement Strict enforcement refuses to load any style sheet crossorigin, unless it is properly labeled text/css. content type misconfigurations are common

Defenses o Minimal Enforcement Block if: o cross-origin o invalid content type o syntactically malformed

Experiment crawled the top 100,000 web sites ranked by Alexa and identified all of the style sheet resources used by their front pages.

Result Strict Enforcement  62 sites ≈ 0.06%

Result Within the Alexa top 100,000 web sites, we observed a total of 1,009 CSS resources labeled with an incorrect content type (excluding responses with HTTP errors). Of these, 572 are associated with sites being rendered in standards mode, and are therefore already being ignored. Of the remaining 437 style sheets, 74 are loaded cross- origin; these are the sheets that would be rejected by the strict defense, breaking 62 (0.06%) of the Alexa sites. This is enough to make browser vendors reluctant to deploy strict enforcement. The minimal defense, which accepts cross-origin, mislabeled sheets unless they are also malformed, would not break any of the top 100,000 sites.

Adoption

Other Client-Side Approaches Block Cookies o Some browsers have the option to block only “third-party” cookies, which prevents cookies from being set by a cross-origin load. o But not read…

Other Client-Side Approaches Block JavaScript Style APIs o Many browsers already prevent JavaScript from reading parsed style rules when those rules were loaded cross-origin.

Server-Side Mitigation Newlines o Internet Explorer HTML Encoding Avoid Ambient Authentication o However, if a URL with a credential becomes visible to the victim user (e.g. via the location bar), they might be tricked into revealing it.

Thank You