Robust Defenses for Cross-Site Request Forgery

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.
Hands-on SQL Injection Attack and Defense HI-TEC July 21, 2013.
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.
Session Hijacking Why web security depends on communications security and how TLS everywhere is the only solution. Scott Helme - 6th Aug scotthel.me.
By Philipp Vogt, Florian Nentwich, Nenad Jovanovic, Engin Kirda, Christopher Kruegel, and Giovanni Vigna Network and Distributed System Security(NDSS ‘07)
EECS 354 Network Security Cross Site Scripting (XSS)
Attacking Session Management Juliette Lessing
CMSC 414 Computer and Network Security Lecture 24 Jonathan Katz.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
IDAsec copyright - all rights reserved1 Web Vulnerabilities in the real world.
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.
Beware of Finer-Grained Origins
AppSec USA 2014 Denver, Colorado CSRF 101 Introduction to Cross-Site Request Forgery.
Lecture 16 Page 1 CS 236 Online Cross-Site Scripting XSS Many sites allow users to upload information –Blogs, photo sharing, Facebook, etc. –Which gets.
Introduction to InfoSec – Recitation 10 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
Origins, Cookies and Security – Oh My! John Kemp, Nokia Mobile Solutions.
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.
Robust Defenses for Cross-Site Request Forgery CS6V Presented by Saravana M Subramanian.
November 13, 2008 Ohio Information Security Forum Attack Surface of Web Applications James Walden Northern Kentucky University
3-Protecting Systems Dr. John P. Abraham Professor UTPA.
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.
Security Scanners Mark Shtern. Popular attack targets Web – Web platform – Web application Windows OS Mac OS Linux OS Smartphone.
Web Spoofing Steve Newell Mike Falcon Computer Security CIS 4360.
1 Topic 2: Lesson 3 Intro to Firewalls Summary. 2 Basic questions What is a firewall? What is a firewall? What can a firewall do? What can a firewall.
Week 10-11c Attacks and Malware III. Remote Control Facility distinguishes a bot from a worm distinguishes a bot from a worm worm propagates itself and.
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.
Building Secure Web Applications With ASP.Net MVC.
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.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation.
Protecting Browsers from DNS Rebinding Attacks Collin Jackson, Adam Barth, Andrew Bortz ACM CCS Systems Modeling & Simulation Lab. Kim.
Lecture 16 Page 1 CS 236 Online Web Security CS 236 On-Line MS Program Networks and Systems Security Peter Reiher.
Module 7: Advanced Application and Web Filtering.
University of Central Florida The Postman Always Rings Twice: Attacking & Defending postMessage in HTML5 Websites Ankur Verma University of Central Florida,
Deconstructing API Security
Protecting Browsers from Extension Vulnerabilities Paper by: Adam Barth, Adrienne Porter Felt, Prateek Saxena at University of California, Berkeley and.
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.
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.
1 Utkarsha MishraCOMPSCI 725 David Silver, Suman Jana, Eric Chen, Collin Jackson, and Dan Boneh. “Password Managers: Attacks and Defenses.” In Proceedings.
Session Management Tyler Moore CS7403 University of Tulsa Slides adapted in part or whole from Dan Boneh, Stanford CS155 1.
Role Of Network IDS in Network Perimeter Defense.
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.
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.
SECURE DEVELOPMENT. SEI CERT TOP 10 SECURE CODING PRACTICES Validate input Use strict compiler settings and resolve warnings Architect and design for.
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
Cross-Site Forgery
Cross-Site Request Forgeries: Exploitation and Prevention
Auditing Etsy The Security of Etsy
Riding Someone Else’s Wave with CSRF
Cross-Site Request Forgery (CSRF) Attack Lab
Web Security Advanced Network Security Peter Reiher August, 2014
Cross Site Request Forgery New Attacks and Defenses
Exploring DOM-Based Cross Site Attacks
Cross Site Request Forgery (CSRF)
Presentation transcript:

Robust Defenses for Cross-Site Request Forgery Adam Barth, Collin Jackson, John C. Mitchell Stanford University, published on CCS ’08 Presented by: HAN Jin

Outline What is CSRF? What is Login CSRF? Existing Defenses Secret Validation Token The Referer Header Custom HTTP Headers Proposal: Origin Header Session Initialization Conclusion

Outline What is CSRF? What is Login CSRF? Existing Defenses Secret Validation Token The Referer Header Custom HTTP Headers Proposal: Origin Header Session Initialization Conclusion

What is CSRF? Cross-site request forgery (CSRF), also known as one-click attack or session riding In a CSRF attack, a malicious site instructs a victim's browser to send a request to an honest site, as if the request were part of the victim's interaction with the honest site. A typical example

A Typical CSRF attack <img src="http://bank/withdraw?account=alice&amount=1000000&for=mary">

CSRF Harmfulness Gmail CSRF vulnerability in 2007: Forward all of David Airey’s email to the attacker, allowed attacker to control davidairey.com 18 million users of eBay's Internet Auction Co. at Auction.co.kr in Korea lost personal information in February 2008 An active exploit of CSRF against residential ADSL routers in Mexico in early 2008 An e-mail with a malicious IMG tag was sent to victims. By accessing the image in the mail, the user initiated a router command to change the DNS entry of a leading Mexican bank, making any subsequent access by a user to the bank go through the attacker's server

CSRF Defined In CSRF attack, the attacker disrupts the integrity of the session user  a web site by injecting network requests via the user’s browser (the browser’s security policy allows web sites to send HTTP requests to any network address) This policy allows an attacker that controls content not otherwise under his or her control: Network Connectivity (behind firewall) Read Browser State (cookie, certificate) Write Browser State (set cookie)

In-Scope Threats (of CSRF) Forum Poster sites permit users to submit passive content, such as images and hyperlinks. Web Attacker own domain name (e.g attacker.com), valid HTTPS certificate ($10), user visit attacker.com Network Attacker control user’s network connection. E.g. evil roter, compromised DNS server Out-of-Scope Threats Cross-site scripting (XSS), Malware, DNS Rebinding, Certificate Errors, Phishing, User Tracking

Outline What is CSRF? What is Login CSRF? Existing Defenses Secret Validation Token The Referer Header Custom HTTP Headers Proposal: Origin Header Session Initialization Conclusion

Login CSRF attack

Outline What is CSRF? What is Login CSRF? Existing Defenses Secret Validation Token The Referer Header Custom HTTP Headers Proposal: Origin Header Session Initialization Conclusion

Secret Validation Token send additional information in each HTTP request which can be used to determine whether the request came from an authorized source can defend login CSRF difficult to implement, forget to implement before login, no session to bind the CSRF token the site must: first create a “pre-session” implement token-based CSRF protection and then transit to a real session after succesful authentication

Token Design Case Study: NoForge Session Identifier user reveal the contents of web pages via email or uploading the web page  token revealed Session-Independent Nonce fails to protect against Active Network Attackers, who can overwrite the Session-Independent Nonce Session-dependent Nonce site has to maintain large state table in order to validate the tokens HMAC of Session Identifier Case Study: NoForge difficulty & complexity to implement Secret Validation Token

Secret Validation Token can defend login CSRF difficult to implement

Outline What is CSRF? What is Login CSRF? Existing Defenses Secret Validation Token The Referer Header Custom HTTP Headers Proposal: Origin Header Session Initialization Conclusion

The Referer Header The Referer (?) header contains the URL of the site making the request E.g. Referer: http://en.wikipedia.org/query?=xxx A site can defend itself against CSRF attacks by checking whether the request was issued by itself Privacy E.g. reveals contents of search queries info about corporate intranets might leak Strictness Lenient Referer validation (wrong-reject, lack-accept) Strict Refer validation (wrong-reject, lack-reject)

Interesting Story Referer is a common misspelling of the word referrer. It is so common, in fact, that it made it into the official specification of HTTP – the communication protocol of the World Wide Web – and has therefore become a widely used industry spelling when discussing HTTP referrers

Empirical Study To evaluate the compatibility of Strict Referer Validation Requests with a Missing or Incorrect Referer Header The “x” and “y” represent the domain names of the primary and secondary web servers, respectively. (283,945 observations)

Discussion on results Cross-domain > same-domain HTTP > HTTPS Referer header > document.referer Referer header is usually suppressed in the network and not in the browser (firewall, proxy, router…)

Outline What is CSRF? What is Login CSRF? Existing Defenses Secret Validation Token The Referer Header Custom HTTP Headers Proposal: Origin Header Session Initialization Conclusion

Custom HTTP Headers Custom HTTP headers can prevent CSRF because the browser prevents sites from sending custom HTTP headers to another site but allows sites to send custom HTTP headers to themselves using XMLHttpRequest The cookie value is not actually required, the presence of the header is sufficient A site must issue all state-modifying requests using XMLHttpRequest, attach the custom header reject all state-modifying requests without the header

Outline What is CSRF? What is Login CSRF? Existing Defenses Secret Validation Token The Referer Header Custom HTTP Headers Proposal: Origin Header Session Initialization Conclusion

Proposal: Origin Header propose modifying browsers to send a Origin header with POST requests that identifies the origin that initiated the request Privacy (Improves Referer header) URL: only scheme, host, port sent only for POST, prevent accidental leakage Similar to four other proposals that identify the initiator of a request. Adopted by several working groups

Origin header Implementation: Browser side: 8-line patch to WebKit, the open source component of Safari 466-line extension to Firefox Server side: a web application firewall for CSRF in three lines of ModSecurity (a web application firewall language for Apache)

Outline What is CSRF? What is Login CSRF? Existing Defenses Secret Validation Token The Referer Header Custom HTTP Headers Proposal: Origin Header Session Initialization Conclusion

Session Initialization Login CSRF is one example of a more general class of vulnerabilities in session initialization Topics not covered in this presentation: Two types of session initialization vul.: Authenticated as User Authenticated as Attacker Two common approaches to mount attack HTTP Request Cookie Overwriting

Outline What is CSRF? What is Login CSRF? Existing Defenses Secret Validation Token The Referer Header Custom HTTP Headers Proposal: Origin Header Session Initialization Conclusion

Long term  Origin header Conclusion Different defenses for different use cases: Login CSRF  strict Referer validation login forms typically submit over HTTPS HTTPS sites  strict Referer validation such as banking sites Third-party Content  secret token validation spend the engineering effort to implement (HMAC token) Long term  Origin header Privacy, both HTTP & HTTPS, no secret tokens leakage