Cross-domain leakiness Divulging sensitive information & attacking SSL sessions Chris Evans - Google Billy Rios - Microsoft.

Slides:



Advertisements
Similar presentations
Nick Feamster CS 6262 Spring 2009
Advertisements

Cross-site Request Forgery (CSRF) Attacks
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.
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
©2009 Justin C. Klein Keane PHP Code Auditing Session 5 XSS & XSRF Justin C. Klein Keane
Common Exploits Aaron Cure Cypress Data Defense. SQL Injection.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation.
EECS 354 Network Security Cross Site Scripting (XSS)
Dynamic Pharming Attacks and Locked Same-Origin Policies For Web Browsers Chris Karlof, J.D. Tygar, David Wagner, Umesh Shankar.
Blackbox Reversing of XSS Filters Alexander Sotirov ekoparty 2008.
IDAsec copyright - all rights reserved1 Web Vulnerabilities in the real world.
It’s always better live. MSDN Events Securing Web Applications Part 1 of 2 Understanding Threats and Attacks.
CROSS SITE SCRIPTING..! (XSS). Overview What is XSS? Types of XSS Real world Example Impact of XSS How to protect against XSS?
Handling Security Threats in Kentico CMS Karol Jarkovsky Sr. Solution Architect Kentico Software
We have you by the gadgets Hitting your OS below the belt.
 A cookie is a piece of text that a Web server can store on a user's hard disk.  Cookie data is simply name-value pairs stored on your hard disk by.
Introduction to InfoSec – Recitation 10 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
Presented by…. Group 2 1. Programming language 2Introduction.
Copyright© 2002 Avaya Inc. All rights reserved Advanced Cross Site Scripting Evil XSS Anton Rager.
Cross-Site Scripting Vulnerabilities Adam Doupé 11/24/2014.
Prevent Cross-Site Scripting (XSS) attack
Introduction to InfoSec – Recitation 7 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
CSCI 6962: Server-side Design and Programming Secure Web Programming.
Lecture 14 – Web Security SFDV3011 – Advanced Web Development 1.
AJAX Without the “J” George Lawniczak. What is Ajax?
BLUEPRINT: Robust Prevention of Cross-site Scripting Attacks for Existing Browsers Mike Ter Louw, V.N. Venkatakrishnan University of Illinois at Chicago.
Robust Defenses for Cross-Site Request Forgery CS6V Presented by Saravana M Subramanian.
© All rights reserved. Zend Technologies, Inc. PHP Security Kevin Schroeder Zend Technologies.
IBM Rational Application Security Group (aka Watchfire) Web Based Man In the Middle Attack © 2009 IBM Corporation 1 Active Man in the Middle Attacks The.
November 13, 2008 Ohio Information Security Forum Attack Surface of Web Applications James Walden Northern Kentucky University
Web 2.0 Security James Walden Northern Kentucky University.
Krishna Mohan Koyya Glarimy Technology Services
3-Protecting Systems Dr. John P. Abraham Professor UTPA.
10/13/2015 ©2006 Scott Miller, University of Victoria 1 Content Serving Static vs. Dynamic Content Web Servers Server Flow Control Rev. 2.0.
Security Scanners Mark Shtern. Popular attack targets Web – Web platform – Web application Windows OS Mac OS Linux OS Smartphone.
Robust Defenses for Cross-Site Request Forgery
Random Logic l Forum.NET l AJAX Behind the buzz word Forum.NET ● January 23, 2006.
CIT 380: Securing Computer SystemsSlide #1 CIT 380: Securing Computer Systems Web Security.
October 3, 2008IMI Security Symposium Application Security through a Hacker’s Eyes James Walden Northern Kentucky University
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Web Applications Testing By Jamie Rougvie Supported by.
Web Security SQL Injection, XSS, CSRF, Parameter Tampering, DoS Attacks, Session Hijacking SoftUni Team Technical Trainers Software University
1 Robust Defenses for Cross-Site Request Forgery Adam Barth, Collin Jackson, John C. Mitchell Stanford University 15th ACM CCS.
Cookies and Sessions IDIA 618 Fall 2014 Bridget M. Blodgett.
Lecture 16 Page 1 CS 236 Online Web Security CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
THE DEVIL IS IN THE (IMPLEMENTATION) DETAILS: AN EMPIRICAL ANALYSIS OF OAUTH SSO SYSTEMS SAN-TSAI SUN & KONSTANTIN BEZNOSOV PRESENTED BY: NAZISH KHAN COMPSCI.
Chapter 10 XML and Web Services. Topics Why a standards-compliant XML parser Why a standard (off the shelf) XML parser Validation. External references.
University of Central Florida The Postman Always Rings Twice: Attacking & Defending postMessage in HTML5 Websites Ankur Verma University of Central Florida,
ICM – API Server & Forms Gary Ratcliffe.
Cookies Lack Integrity: Real-World Implications
CSRF Attacks Daniel Chen 11/18/15. What is CSRF?  Cross Site Request Forgery (Sea-Surf)  AKA XSRF/ One Click / Sidejacking / Session Riding  Exploits.
Session Management Tyler Moore CS7403 University of Tulsa Slides adapted in part or whole from Dan Boneh, Stanford CS155 1.
IE Developer Tools Jonathan Seitel Program Manager.
By Collin Donaldson. Hacking is only legal under the following circumstances: 1.You hack (penetration test) a device/network you own. 2.You gain explicit,
PHP: Further Skills 02 By Trevor Adams. Topics covered Persistence What is it? Why do we need it? Basic Persistence Hidden form fields Query strings Cookies.
Carrie Estes Collin Donaldson.  Zero day attacks  “zero day”  Web application attacks  Signing up for a class  Hardening the web server  Enhancing.
Page 1 Ethical Hacking by Douglas Williams. Page 2 Intro Attackers can potentially use many different paths through your application to do harm to your.
IBM Rational Application Security Group (aka Watchfire) Web Based Man In the Middle Attack © 2009 IBM Corporation 1 Active Man in the Middle Attacks The.
SlideSet #20: Input Validation and Cross-site Scripting Attacks (XSS) SY306 Web and Databases for Cyber Operations.
Web Security (cont.) 1. Referral issues r HTTP referer (originally referrer) – HTTP header that designates calling resource  Page on which a link is.
An Introduction to Web Application Security
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
World Wide Web policy.
Cross-Site Forgery
Less Known Web Application Vulnerabilities
Riding Someone Else’s Wave with CSRF
CSC 495/583 Topics of Software Security Intro to Web Security
WWW安全 國立暨南國際大學 資訊管理學系 陳彥錚.
Active Man in the Middle Attacks
Presentation transcript:

Cross-domain leakiness Divulging sensitive information & attacking SSL sessions Chris Evans - Google Billy Rios - Microsoft

Who are we? Chris Evans o Troublemaker, Engineer, Tech Lead, Google Security Team o o Billy Rios o Model, Security Engineer, Microsoft o

Shoulders of giants Credits Filipe Almeida, Google Michal Zalewski, Google Drew Hintz, Google Kanatoko

Cross-domain leakiness Overview Introduction Background information Cross-domain bugs Cross-domain issues by design Attacking browser SSL sessions Demo

Cross-domain leakiness Introduction Is your web app cross-domain safe? What about your users' browsers?

Background information Man-in-the-middle (MITM) Someone who can intercept your network traffic o Particularly on wireless networks No MITM o Attacks you via enticing to evil URLs Passive MITM o Only reads your traffic going past o e.g.: government black ISP Active MITM o Can also forge responses / requests o e.g.: free wireless

Background information Single session browsing A model of web usage for paranoid users Based on distrust o Of same origin policy o Of browser's security o Of separation of data o Of web app

Background information Cross-site script inclusion Sometimes called XSSI Sometimes bucketed under XSRF / CSRF Loads remote authenticated resource o

Background information Cookie security model Original cookie model: o Send if domain, path match Same origin policy added for DOM access: o Grant access if protocol, domain, port match Cookie model leaked https cookies over http o "Secure" cookie attribute added

Cross-domain bugs Firefox #1: image theft Can steal authenticated images Introduced with canvas getImageData() o Or toDataUrl() Previously no way to read image pixels Domain is checked but 302 redirect trick works WebKit nightly also had same bug 302 redirect trick also worked in past Simple demo

Cross-domain bugs Firefox #2: hex string theft Can steal authenticated hex strings Affects FF3.0.3; probably not getting fixed in time for conference so no details Simple demo

Cross-domain bugs Safari #1: File theft Not yet fixed so withholding details Failure to do origin check in obscure cross-domain area Simple demo

Cross-domain bugs Safari #2: XML theft Also not yet fixed XML often used as protocol for: o AJAX apps o Web services o Feeds (including authenticated ones) Also don't forget XHTML Simple demo

Cross-domain bugs Safari #3: File theft Fixed with CVE Failure to enforce remote to local boundaries Involves Java Demo

Cross-domain bugs WebKit: pixel theft Nice combination of features came together in WebKit nightlycombination of features came together Illustrates danger of unexpected interactions Collaborating features: o SVG support o SVG as target o getImageData() o within SVG Could be worse with

Cross-domain bugs You want more? New browser features always adding new cross- domain areas and interactions o Sometimes obscure Need a comprehensive list of where browsers will handle data cross-domain Spreadsheet to document areas and testing: o 3fodP3jM-lyIwjwSw 3fodP3jM-lyIwjwSw

What’s in a Name? Case Study: Flash DNS Rebinding Quick reminder of DNS Rebinding / Pinning Issues The Attacker controls DNS for Foo.com Make a request for Foo.com, foo.com points to The Attacker changes the DNS entry for Foo.com to Attacker uses previously loaded content to steal information from

What’s in a Name? Case Study: Flash DNS Rebinding Fixed with CVE Distinguishing between two forms of the same name Jumperz (Kanatoko) is the MAN! o Based off of the original, but with a small twist

What’s in a Name? Case Study: Flash DNS Rebinding Dealing with domain names ending with a “.” Now, are XS-Sniper.com and XS-Sniper.com. the same? Sockets in Flash made things interesting ☺ This is fixed… why talk about this now?

Design issue CSS property theft Browsers load CSS cross-domainload CSS cross-domain o Browsers auto-detect and extract inline from HTML Can read property values from JavaScript Great cross-app way of determining login status Not much of sensitivity stored in properties yet

Design issue XSSI - remote script inclusion This problem is nasty because it gets worse over time! o More and more textual constructs are becoming valid JavaScript Valid JavaScript from remote domain will execute just fine Can't read source but can observe side effects from executing source

Cross-site script inclusion XSSI: stealable constructs Function callback o e.g. "callback_func(1, 'data');" Setting variables o e.g."var result = 100;" Function definition o e.g. "function blah() { var a = 1; }" JavaScript array data (FireFox 2) o e.g. "[1, 2, 3, 4]"

XSSI Future directions XML theft o Remembering that XHTML and some HTML parses as XML o XML is valid JavaScript with E4X support  FireFox2, FireFox3 Theft via JavaScript injection into XMLJavaScript injection into XML Random FireFox bug: XML injection into XML

XSSI Future directions Core language overloads o Overload XML constructors o Overload Number constructor o Overload Error types o Overload primitive objects

XSSI Remediation Apply XSRF protection o Not feasible to do for all authenticated GETs Break JavaScript execution or syntax o while(1); is seen a lot  What if the "1" fired Number() o Prefer to break syntax hard or use something unlikely to be overloadable o e.g. "for (;;);" or ")]}" Include XML prolog and DTD always

Active MITM against SSL sites Mixing Content… it shouldn’t be DONE! Find insecure script references (images may work too) FORCE the loading of insecure script references over HTTPS Now an attacker can MITM an SSL protected site without ANY WARNINGS! Real Life Examples…

Design issue Cookie forcing Name picked based on Google Search o "Cookie forcing" -> 123 hits OMG! Name does not have "jacking" in it o Call it "cookie force-jacking" if that would make you happy :)

Cookie forcing What is it? The cookie model is still a bit dangerous, even with Secure flag "Read" was fixed but not "Write" Therefore, can overwrite Secure cookies used by This part is well known and not new o New part is attack details / delivery mechanism

Cookie forcing What can evil cookies do? Apps often trust their cookies completely o I put it there so I can trust it o Using https so not expecting integrity violation Evil cookie forcing is sidejacking to the max - breaking an https app despite it following (current) best practices

Cookie forcing XSS via cookie planting App escaped the cookie on write so no need to be careful on read, right? XSS via HTML generation or DOM access XSS via JSON eval()

Cookie forcing XSRF via cookie planting One common XSRF protection is to compare nonce with URL param For apps at scale, store nonce in cookie Now, attacker controls nonce cookie and URL param!

Cookie forcing App logic cookies Some cookies affect app logic Irritations o Display language o Persistently break app More seriously o Sensitive settings o Debug modes

Cookie forcing Login / logout XSRF Not much to stop you dropping in attacker's account's auth cookie o (Well, see mitigations to follow) Same applies to nuking existing auth cookie Attack can be "silent" Theft of data on POST thwarted by XSRF protection o How does app behave with XSRF token mismatch?

Cookie forcing Mitigations Assume cookie data is evil o Parse and escape it, don't eval() it Sign your sensitive cookies o Do not forget to tie to user o Best to tie to current session Login / logout XSRF is hard o You can randomize your cookie names o But then must handle attacker's dupes  Which is the real one?!

Attacking the paranoid Accessing your bank? Recall the 1 window, 1 tab model Hit https bookmark only Then you got pwned o What happened?

Attacking the paranoid What's your browser up to? Updating anti-phishing / malware lists Loading https cert details... over http Update pings RSS feed updates

Attacking the paranoid Hmm... plain http Attacker can respond with 302 redirect o To arbitrary domain Browser sends out new request Attacker can respond with some cookies Set or clear arbitrary cookies on any domain o Including those marked Secure o Or could shadow existing cookies Beauty of attack is silence o Background request redirects not noisy on URL bar

Attacking the paranoid Other opportunties Poison cache to affect future sessions o http only Poison cookies to affect future sessions

Attacking the paranoid Mitigations Do not rely on browser https to provide integrity on untrusted networks Use VPN to a more trusted network Disable browser's features leading to plain http requests (but did you miss one?) Set your proxy to localhost:1 for http protocol

Demo For cookie forcing

Q & A