Cross-site request forgery Collin Jackson CS 142 Winter 2009.

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.
Protecting Browsers from Cross-Origin CSS Attacks Lin-Shung Huang, Zack Weinberg Carnegie Mellon University Chris Evans Google Collin Jackson Carnegie.
A NTI S AMY J AVA I NTRODUCTION Wang Wenjun June 2011.
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.
The Devil is in the (Implementation) Details: An Empirical Analysis of OAuth SSO Systems San-Tsai Sun and Konstantin Beznosov University of British Columbia.
Common Exploits Aaron Cure Cypress Data Defense. SQL Injection.
CMSC 414 Computer and Network Security Lecture 19 Jonathan Katz.
Mitigating Malware Collin Jackson CS142 – Winter 2009.
EECS 354 Network Security Cross Site Scripting (XSS)
COMP 321 Week 12. Overview Web Application Security  Authentication  Authorization  Confidentiality Cross-Site Scripting Lab 12-1 Introduction.
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.
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.
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.
Frame isolation and the same origin policy Collin Jackson CS 142 Winter 2009.
Towards a Formal Foundation of Web Security devdatta akhawe / adam barth / peifung eric lam john mitchell / dawn song.
Origins, Cookies and Security – Oh My! John Kemp, Nokia Mobile Solutions.
Prevent Cross-Site Scripting (XSS) attack
Web Security Borrowed from John Mitchell, Stanford.
CSCI 6962: Server-side Design and Programming Secure Web Programming.
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.
Krishna Mohan Koyya Glarimy Technology Services
OMash: Enabling Secure Web Mashups via Object Abstractions Steven Crites, Francis Hsu, Hao Chen UC Davis.
Web Programming Language Week 7 Dr. Ken Cosh Security, Sessions & Cookies.
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.
Feedback #2 (under assignments) Lecture Code:
Robust Defenses for Cross-Site Request Forgery
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
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 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.
Ethical Hacking: Hacking GMail. Teaching Hacking.
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,
The Unexpected Dangers of Dynamic JavaScript Presenter: Hao Xu Computer Science The College of William & Mary Sebastian Lekies, Ben Stock, Martin Wenzel.
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.
Securing Angular Apps Brian Noyes
ACM Conference on Computer and Communications Security 2006 Puppetnet: Misusing web browsers as a distributed attack infrastructure Network Seminar Presenter:
Cookies Lack Integrity: Real-World Implications
Automatic and Precise Client-Side Protection against CSRF Attacks.
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.
Web Application with AJAX CS 526 advanced interned and Web system Presenters Faris Kateb Mohammed AbdulAziz Omar Alzahrani.
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.
SECURE DEVELOPMENT. SEI CERT TOP 10 SECURE CODING PRACTICES Validate input Use strict compiler settings and resolve warnings Architect and design for.
Building Secure ColdFusion Applications
NodeJS Security Using PassportJS and HelmetJS:
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
Modeling User Interactions for (Fun and) Profit Preventing Request Forgery Attacks in Web Applications Karthick Jayaraman, Grzegorz Lewandowski, Paul G.
World Wide Web policy.
API Security Auditing Be Aware,Be Safe
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
Cross-Site Request Forgeries: Exploitation and Prevention
Riding Someone Else’s Wave with CSRF
Cross Site Request Forgery New Attacks and Defenses
Cross Site Request Forgery (CSRF)
Web browser and Web application security
Presentation transcript:

Cross-site request forgery Collin Jackson CS 142 Winter 2009

Outline Classic CSRF Server-side Defenses Advanced Attacks Proposals for client-side changes

Data export Many ways to send information to other origins No user involvement required Cannot read back response

Classic CSRF attack User visits victim site site Logs in User loads attacker's site Or encounters attacker's iframe on another site Attacker sends HTTP requests to victim Victim site assumes requests originate from itself

Classic CSRF Attack User credentials Cookie: SessionID=523FA4cd2E

DEFENSES

CSRF Defenses Secret Validation Token Referer Validation Custom HTTP Header Referer: X-Requested-By: XMLHttpRequest

Secret Token Validation Requests include a hard-to-guess secret Unguessability substitutes for unforgeability Variations Session identifier Session-independent token Session-dependent token HMAC of session identifier See "Robust Defenses for Cross-Site Request Forgery" for a comparison of these options.

Secret Token Validation

Referer Validation

Referer Validation Defense HTTP Referer header Referer: Referer: Referer: Lenient Referer validation Doesn't work if Referer is missing Strict Referer validaton Secure, but Referer is sometimes absent…  ?

Referer Privacy Problems Referer may leak privacy-sensitive information projects/iphone/competitors.html Common sources of blocking: Network stripping by the organization Network stripping by local machine Stripped by browser for HTTPS -> HTTP transitions User preference in browser Buggy user agents Site cannot afford to block these users

Suppression Measurement 283,945 impressions

Suppression over HTTPS is low

Lenient Validation Vulnerability My site uses HTTPS, am I safe? Problem: Browsers do not append Referer if the source of the request is not an HTTP page ftp://attacker.com/attack.html data:text/html, … javascript:' … '

Strict Validation Problems Some sites allow users to post forms XSS sanitization doesn't include These sites need another defense Many sites allow users to post hyperlinks Solution: Respect HTTP verb semantics GET requests have no side effects POST requests can change state

Custom Header Defense XMLHttpRequest is for same-origin requests Can use setRequestHeader within origin Limitations on data export format No setRequestHeader equivalent XHR2 has a whitelist for cross-site requests Issue POST requests via AJAX: Doesn't work across domains X-Requested-By: XMLHttpRequest

ANNOUNCEMENTS Project 2, Mac OSX Tiger

ADVANCED ATTACKS

Broader view of CSRF Abuse of cross-site data export feature From user’s browser to honest server Disrupts integrity of user’s session Why mount a CSRF attack? Network connectivity Read browser state Write browser state Not just “session riding”

Login CSRF Attacker’s credentials

Payments Login CSRF

Rails vs. Login CSRF

Login CSRF Fails

CLIENT-SIDE DEFENSES

Can browsers help with CSRF? Does not break existing sites Easy to use Hard to misuse Allows legitimate cross-site requests Reveals minimum amount of information Can be standardized

Proposed Approaches HTTP Headers Identify the source of requests Change Referer header or add a new Origin header Send more information for POST than GET Experiment: Cross-domain POSTs out of firewall accounted for ~0.0001% of traffic Problem: Unsafe GET requests Problem: Third-party content within an origin Problem: How to handle redirects Same-origin-only cookies Doesn't help multi-domain sites: amazon.com and amazon.co.uk These sites could use other defenses

Conclusion Server-side defenses are required Secret token validation – use frameworks like Rails Referer validation – works over HTTPS Custom headers – for AJAX No easy solution User does not need to have an existing session for attacks to work Hard to retrofit existing applications with defenses