Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.

Slides:



Advertisements
Similar presentations
Nick Feamster CS 6262 Spring 2009
Advertisements

Cross-site Request Forgery (CSRF) Attacks
© 2009 IBM Corporation IBM Rational Application Security The Bank Job Utilizing XSS Vulnerabilities Adi Sharabani IBM Rational Application Security Research.
Hands-on SQL Injection Attack and Defense HI-TEC July 21, 2013.
A NTI S AMY J AVA I NTRODUCTION Wang Wenjun June 2011.
©2009 Justin C. Klein Keane PHP Code Auditing Session 5 XSS & XSRF Justin C. Klein Keane
Attacking Authentication and Authorization CSE 591 – Security and Vulnerability Analysis Spring 2015 Adam Doupé Arizona State University
ATTACKING AUTHENTICATION The Web Application Hacker’s Handbook, Ch. 6 Presenter: Jie Huang 10/31/2012.
1 Project 2: Web App Security Collin Jackson CS 155 Spring 2007.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
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.
It’s always better live. MSDN Events Security Best Practices Part 2 of 2 Reducing Vulnerabilities using Visual Studio 2008.
It’s always better live. MSDN Events Securing Web Applications Part 1 of 2 Understanding Threats and Attacks.
AppSec USA 2014 Denver, Colorado CSRF 101 Introduction to Cross-Site Request Forgery.
The OWASP Foundation Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under.
WEB SECURITY WORKSHOP TEXSAW 2013 Presented by Joshua Hammond Prepared by Scott Hand.
Introduction to InfoSec – Recitation 10 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Workshop 3 Web Application Security Li Weichao March
OWASP Zed Attack Proxy Project Lead
Cosc 4765 Server side Web security. Web security issues From Cenzic Vulnerability report
Cross-Site Scripting Vulnerabilities Adam Doupé 11/24/2014.
Origins, Cookies and Security – Oh My! John Kemp, Nokia Mobile Solutions.
Lets Make our Web Applications Secure. Dipankar Sinha Project Manager Infrastructure and Hosting.
WEB SECURITY WEEK 3 Computer Security Group University of Texas at Dallas.
WEB SPOOFING by Miguel and Ngan. Content Web Spoofing Demo What is Web Spoofing How the attack works Different types of web spoofing How to spot a spoofed.
CSCI 6962: Server-side Design and Programming Secure Web Programming.
Lecture 14 – Web Security SFDV3011 – Advanced Web Development 1.
Robust Defenses for Cross-Site Request Forgery CS6V Presented by Saravana M Subramanian.
Copyright 2007 © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Copyright 2007 © 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.
Cross-Site Attacks James Walden Northern Kentucky University.
Top Five Web Application Vulnerabilities Vebjørn Moen Selmersenteret/NoWires.org Norsk Kryptoseminar Trondheim
© Copyright 2013 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice. 1 RubyJax Brent Morris/
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.
Forms and Server Side Includes. What are Forms? Forms are used to get user input We’ve all used them before. For example, ever had to sign up for courses.
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation.
The attacks ● XSS – type 1: non-persistent – type 2: persistent – Advanced: other keywords (, prompt()) or other technologies such as Flash.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation.
Evil Code and how to defend against it CSCI 4300
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Cross-site request forgery Collin Jackson CS 142 Winter 2009.
Copyright © The OWASP Foundation This work is available under the Creative Commons SA 2.5 license The OWASP Foundation OWASP Denver February 2012.
AJAX Use Cases for WSRP Subbu Allamaraju BEA Systems Inc WSRP F2F Meeting, May 2006.
CSRF Attacks Daniel Chen 11/18/15. What is CSRF?  Cross Site Request Forgery (Sea-Surf)  AKA XSRF/ One Click / Sidejacking / Session Riding  Exploits.
Dos and Don’ts of Client Authentication on the Web Kevin Fu, Emil Sit, Kendra Smith, Nick Feamster Presented: Jesus F. Morales.
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,
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.
CSCE 548 Student Presentation Ryan Labrador
An Introduction to Web Application Security
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.
Ofer Shezaf, CTO, Breach Security
Cross-Site Forgery
CSC 482/582: Computer Security
Automatic and Precise Client-Side Protection against CSRF Attacks
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
CSC 482/582: Computer Security
Cross Site Request Forgery New Attacks and Defenses
Cross Site Request Forgery (CSRF)
Presentation transcript:

Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP Foundation OWASP Cross-Site Request Forgery: Danger, Detection, and Defenses Eric Sheridan Aspect Security, Inc

OWASP Overview  Discussion of the “Same Origin Policy”  Overview of the “Sleeping Giant”  The Introduction of  2 New OWASP Tools  A Series of New WebGoat Labs  Enterprise CSRF Mitigation Strategy 2

OWASP The Browser “Same Origin” Policy 3 bank.com blog.net XHR document, cookies TAG JS

OWASP Cross-Site Request Forgery 4 bank.com attacker’s post at blog.net Go to Transfer Assets Select FROM Fund Select TO Fund Select Dollar Amount Submit Transaction Confirm Transaction

OWASP How Does CSRF Work?  Tags  Autoposting Forms  XmlHttpRequest  Subject to same origin policy 5

OWASP Credentials Included 6 bank.com blog.net JSESSIONID=AC934234…

OWASP New Tool: OWASP CSRFTester  Test your applications for CSRF  Record and replay transactions  Tune the recorded test case  Run test case with exported HTML document  Test case alternatives  Auto-Posting Forms  Evil iFrame  IMG Tag  XMLHTTPRequest  Link 7

OWASP DEMO: OWASP CSRFTester 8

OWASP What Can Attackers Do with CSRF?  Anything an authenticated user can do  Click links  Fill out and submit forms  Follow all the steps of a wizard interface  No restriction from same origin policy, except…  Attackers cannot read responses from other origins  Limited on what can be done with data  Severe impact on accountability  Log entries reflect the actions a victim was tricked into executing 9

OWASP Using CSRF to Attack Internal Pages 10 attacker.com internal.mybank.com Allowed! CSRF Internal Site TAG internal browser

OWASP Misconceptions – Defenses That Don’t Work  Only accept POST  Stops simple link-based attacks (IMG, frames, etc.)  But hidden POST requests can be created with frames, scripts, etc…  Referer checking  Some users prohibit referers, so you can’t just require referer headers  Techniques to selectively create HTTP request without referers exist  Requiring multi-step transactions  CSRF attack can perform each step in order  URL Rewriting  General session id exposure in logs, cache, etc. None of these approaches will sufficiently protect against CSRF!

OWASP Add Token to HTML New Tool: OWASP CSRFGuard User (Browser) Business Processing OWASP CSRFGuard Verify Token 1. Add token with regex 2. Add token with HTML parser 3. Add token in browser with Javascript  Adds token to:  href attribute  src attribute  hidden field in all forms  Actions:  Log  Invalidate  Redirect

OWASP DEMO: OWASP CSRFGuard

OWASP Similar Implementations  PHP CSRFGuard  PHP Implementation of CSRFGuard   JSCK  PHP & JavaScript implementation 

OWASP DEMO: Cross-Site Scripting vs. CSRFGuard 15

OWASP Enterprise CSRF Mitigation Strategy  Balance Between Security, Usability, and Cost 16 Challenge Response One-Time Token CAPTCHA Transaction Signing Unique Request Tokens Unique URL Token Worth the time and money?

OWASP

OWASP Extra: How Widespread Are CSRF Holes?  Very likely in most web applications  Including both intranet and external apps  Including Web 1.0 and Web 2.0 applications  Any function without specific CSRF defenses is vulnerable  How do victims get attacked?  Victim simply opens an infected webpage, HTML file, or  Single Sign On (SSO) extends “authenticated user”  CSRF recently found in 8 security appliances  Including CheckPoint 18

OWASP Extra: Real World CSRF Examples /AddToQueue? movieid=

OWASP Extra: CSRF Defenses  CAPTCHA  Attacker must know CAPTCHA answer  Assuming a secure implementation  Re-Authentication  Password Based  Attacker must know victims password  If password is known, then game over already!  One-Time Token  Attacker must know current token  Very strong defense!  Unique Request Tokens  Attacker must know unique request token for particular victim for particular session  Assumes token is cryptographically secure and not disclosed.  /accounts?auth=687965fdfaew87agrde … 20