1 Robust Defenses for Cross-Site Request Forgery Adam Barth, Collin Jackson, John C. Mitchell Stanford University 15th ACM CCS.

Slides:



Advertisements
Similar presentations
Nick Feamster CS 6262 Spring 2009
Advertisements

Protecting Browser State from Web Privacy Attacks Collin Jackson, Andrew Bortz, Dan Boneh, John Mitchell Stanford University.
Cross-site Request Forgery (CSRF) Attacks
ForceHTTPS: Protecting High-Security Web Sites from Network Attacks Collin Jackson and Adam Barth.
Protecting Browsers from Cross-Origin CSS Attacks Lin-Shung Huang, Zack Weinberg Carnegie Mellon University Chris Evans Google Collin Jackson Carnegie.
17 th ACM CCS (October, 2010).  Introduction  Threat Model  Cross-Origin CSS Attacks  Example Attacks  Defenses  Experiment  Related Work 2 A Presentation.
CMSC 414 Computer and Network Security Lecture 24 Jonathan Katz.
A Third Party Service for Providing Trust on the Internet Work done in 2001 at HP Labs by Michael VanHilst and Ski Ilnicki.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
1 A Privacy-Preserving Defense Mechanism Against Request Forgery Attacks Ben S. Y. Fung and Patrick P. C. Lee The Chinese University of Hong Kong TrustCom’11.
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.
It’s always better live. MSDN Events Securing Web Applications Part 1 of 2 Understanding Threats and Attacks.
Detecting Fraudulent Clicks From BotNets 2.0 Adam Barth Joint work with Dan Boneh, Andrew Bortz, Collin Jackson, John Mitchell, Weidong Shao, and Elizabeth.
Beware of Finer-Grained Origins
Cookies COEN 351 E-commerce Security. Client / Session Identification HTTP does not maintain state. State Information can be passed using: HTTP Headers.
 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)
Martin Kruliš by Martin Kruliš (v1.0)1.
Towards a Formal Foundation of Web Security devdatta akhawe / adam barth / peifung eric lam john mitchell / dawn song.
HTTP and Server Security James Walden Northern Kentucky University.
Cross-Site Scripting Vulnerabilities Adam Doupé 11/24/2014.
Cookies Set a cookie – setcookie() Extract data from a cookie - $_COOKIE Augment user authentication script with a cookie.
Origins, Cookies and Security – Oh My! John Kemp, Nokia Mobile Solutions.
Remotely authenticating against the Service Framework.
Lecture 14 – Web Security SFDV3011 – Advanced Web Development 1.
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.
Optimizing Traditional and Advocating New Prevention Methods Mark Jenne Tatiana Alexenko Cross-Site-Request-Forgery.
CSE 154 LECTURE 12: COOKIES. Including files: include include("filename"); PHP include("header.html"); include("shared-code.php"); PHP inserts the entire.
OMash: Enabling Secure Web Mashups via Object Abstractions Steven Crites, Francis Hsu, Hao Chen (UC Davis) ACM Conference on Computer and Communications.
BetterAuth: Web Authentication Revisited Martin Johns, Sebastian Lekies, Bastian Braun, Benjamin Flesch In ACSAC /01/08 A.C. ADL.
OWL Jan How Websites Work. “The Internet” vs. “The Web”?
Cross-Site Attacks James Walden Northern Kentucky University.
Robust Defenses for Cross-Site Request Forgery
Web Security SQL Injection, XSS, CSRF, Parameter Tampering, DoS Attacks, Session Hijacking SoftUni Team Technical Trainers Software University
Cookies and Sessions IDIA 618 Fall 2014 Bridget M. Blodgett.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation.
CS 4244: Internet Programming Security 1.0. Introduction Client identification and cookies Basic Authentication Digest Authentication Secure HTTP.
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.
Cookies COEN 351 E-commerce Security. Client / Session Identification HTTP Headers Client IP Address HTTP User Login FAT URLs Cookies.
Presented By: Chandra Kollipara. Cross-Site Scripting: Cross-Site Scripting attacks are a type of injection problem, in which malicious scripts are injected.
CS526Topic 12: Web Security (2)1 Information Security CS 526 Topic 9 Web Security Part 2.
Web Security Lesson Summary ●Overview of Web and security vulnerabilities ●Cross Site Scripting ●Cross Site Request Forgery ●SQL Injection.
Web2.0 Secure Development Practice Bruce Xia
Cross-site request forgery Collin Jackson CS 142 Winter 2009.
Securing Angular Apps Brian Noyes
1 State and Session Management HTTP is a stateless protocol – it has no memory of prior connections and cannot distinguish one request from another. The.
Cookies Lack Integrity: Real-World Implications
Web Application (In)security Note: Unless noted differently, all scanned figures were from the textbook, Stuttard & Pinto, 2011.
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.
COEN 350: Network Security E-Commerce Issues. Table of Content HTTP Authentication Cookies.
Intro to Web Application Security. iHostCodex Web Services - CEO Project-AG – CoFounder OWASP Panay -Chapter Leader -Web Application Pentester -Ethical.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
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.
SlideSet #20: Input Validation and Cross-site Scripting Attacks (XSS) SY306 Web and Databases for Cyber Operations.
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
World Wide Web policy.
API Security Auditing Be Aware,Be Safe
Ofer Shezaf, CTO, Breach Security
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 Forgery
Riding Someone Else’s Wave with CSRF
CSC 495/583 Topics of Software Security Intro to Web Security
Cross-Site Request Forgery (CSRF) Attack Lab
Cross Site Request Forgery New Attacks and Defenses
Exploring DOM-Based Cross Site Attacks
Cross Site Request Forgery (CSRF)
Presentation transcript:

1 Robust Defenses for Cross-Site Request Forgery Adam Barth, Collin Jackson, John C. Mitchell Stanford University 15th ACM CCS

2 Cross-Site Request Forgery Cross-Site Request Forgery (CSRF) attack A malicious site instructs a victim’s browser to send a request to an honest site Leveraging the victim’s network connectivity and browser’s state, such as cookies, to disrupt the integrity of the victim’s session with the honest site

3 Three defending techniques Validating a secret request token Most popular Fraught with pitfalls Validating the HTTP Referer header Simplest Referer header can be suppressed Validating custom headers attached to XMLHttpRequests AJAX interface Requires sites to valid all state-modifying requests

4 Contributions An explanation of the CSRF threat model A study of current browser behavior A proposal for an Origin header containing the information necessary for CSRF defense A study of related session initialization vulnerabilities

5 CSRF Network Connectivity Read Browser State Write Browser State In-Scope Threats Forum Poster Web Attacker Network Attacker Out-of-Scope Threats XSS, Malware, DNS Rebinding, Certificate Errors, Phishing, User Tracking

6 LOGIN CSRF attack (1/2) The attacker forges a login request to an honest site using the attacker’s user name and password at that site

7 LOGIN CSRF attack (2/2) Honest server responds with a Set-Cookie header that instructs the browser to mutate its state by storing a session cookie, logging the user into the honest site as the attacker Session cookie is used to bind subsequent requests to the user’s session and hence to the attacker’s authentication credential

8 LOGIN CSRF attack Search History Paypal iGoogle

9 Existing CSRF Defenses Secret Validation Token Session Identifier, Nonce, HMAC of Session Identifier The Referer Header Lenient Referer Validation Strict Referer Validation Custom HTTP Headers Attach the custom header XMLHttpRequest

10 Experiment (1/4) Design Adverting networks from 5 April 2008 to 8 April advertisement impressions from unique IP address GET and POST requests both over HTTP and HTTPS Requests are generated by submitting forms, requesting images, and issuing XMLHttpRequests Same-domain requests to the primary server and cross- domain requests to the secondary server Log Referer header, User-Agent header, date, client’s class C network, session identifier, document.referer Did not log the client’s IP address, instead logged the HMAC of client’s IP address

11 Experiment (2/4) Results Discussion The Referer header is suppressed more often for HTTP requests than for HTTPS requests Browsers that suppress the Referer header also suppress the document.referrer value But when Referer is suppressed in the network, the document.referrer value is not suppressed

12 Experiment (3/4) The document.referrer value being suppressed PlayStation 3 browser does not support Opera suppresses for cross-site HTTPS request Bug in Firefox 1.0 and 1.5

13 Experiment (4/4) Conclusion CSRF Defense over HTTPS HTTP: percentage (3-11%) of users HTTPS: percentage ( %) of users Site must reject requests that omit the Referer header Privacy Matters Must address privacy concerns in order to effective in large-scale deployments

14 Proposal: Origin header Privacy Includes only the information required to identify the principal that initiated the request Sent only for POST requests Server Behavior All state-modifying requests, including login requests, must be sent using the POST method Server must reject any requests whose Origin header contains an undesired value

15 Proposal: Origin header Security Analysis Rollback and Suppression, DNS Rebinding,Plug- ins Adoption Improves and unifies four other proposals and has been adopted by several working groups Implementation Browser side: WebKit, Safari, Firefox Server side: ModSecurity, Apache

16 Session Initialization Authenticated as User Predictable session identifier Authenticated as Attacker Login CSRF Two common approaches to mounting an attack on session initialization HTTP Requests and Cookie Overwriting

17 HTTP Requests (1/2) OpenID 1. Web attacker visits the Relying Party (Blogger) and beings the authentication process with the Identity Provider (Yahoo!) 2. Identity Provider redirects the attacker’s browser to the “return to” URL of the Relying Party 3. attacker directs the user’s browser to the return to URL 4. The Relying Party completes the OpenID protocol and stores a session cookie in the user’s browser 5. The user is now logged in as the attacker

18 HTTP Requests (2/2) PHP Cookieless Authentication 1. The web attacker logs into the honest web site 2. The web attacker redirects the user’s browser to the URL currently displayed in the attacker’s location bar 3. Because this URL contains the attacker’s session identifier, the user is now logged in as the attacker

19 Cookie Overwriting An active network attacker can supply a Set- Cookie header over a HTTP connection to the same host name as the site and install either a Secure or a non-Secure cookie of the same name Defense cannot be deployed “without breaking standards and existing web apps” Cookie-Integrity header

20 Related Work RequestRodeo Strips implicit authorization information from outgoing cross-site HTTP requests Breaks existing web site functionality CAPTCHA Attacker can manually solve CAPTCHAs

21 Conclusions and Advice Login CSRF Strict Referer validation HTTPS Served over HTTPS Third-party Content Images, hyperlinks should use a framework that implements secret token validation correctly Origin header Eliminating the privacy concerns HTTPS and non-HTTPS requests both work

22 My Comments Will Origin header be widely used Still exist so many Out-of-Scope threats