Ofer Shezaf, CTO, Breach Security

Slides:



Advertisements
Similar presentations
Cross-Site Scripting Issues and Defenses Ed Skoudis Predictive Systems © 2002, Predictive Systems.
Advertisements

Nick Feamster CS 6262 Spring 2009
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.
OWASP Web Vulnerabilities and Auditing
Lecture 6/2/12. Forms and PHP The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input When dealing with HTML forms.
©2009 Justin C. Klein Keane PHP Code Auditing Session 5 XSS & XSRF Justin C. Klein Keane
EECS 354 Network Security Cross Site Scripting (XSS)
Network Isolation Using Group Policy and IPSec Paula Kiernan Senior Consultant Ward Solutions.
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.
It’s always better live. MSDN Events Security Best Practices Part 2 of 2 Reducing Vulnerabilities using Visual Studio 2008.
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.
Information Networking Security and Assurance Lab National Chung Cheng University 1 Top Vulnerabilities in Web Applications (I) Unvalidated Input:  Information.
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)
OWASP Zed Attack Proxy Project Lead
Copyright© 2002 Avaya Inc. All rights reserved Advanced Cross Site Scripting Evil XSS Anton Rager.
Cosc 4765 Server side Web security. Web security issues From Cenzic Vulnerability report
Origins, Cookies and Security – Oh My! John Kemp, Nokia Mobile Solutions.
Prevent Cross-Site Scripting (XSS) attack
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.
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.
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.
Krishna Mohan Koyya Glarimy Technology Services
Cross-Site Attacks James Walden Northern Kentucky University.
Top Five Web Application Vulnerabilities Vebjørn Moen Selmersenteret/NoWires.org Norsk Kryptoseminar Trondheim
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Security (Keep your site secure at extension level) Sergey Gorstka Fastw3b.
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.
PwC New Technologies New Risks. PricewaterhouseCoopers Technology and Security Evolution Mainframe Technology –Single host –Limited Trusted users Security.
COMP9321 Web Application Engineering Semester 2, 2015 Dr. Amin Beheshti Service Oriented Computing Group, CSE, UNSW Australia Week 9 1COMP9321, 15s2, Week.
Mr. Justin “JET” Turner CSCI 3000 – Fall 2015 CRN Section A – TR 9:30-10:45 CRN – Section B – TR 5:30-6:45.
Securing Angular Apps Brian Noyes
Copyright © The OWASP Foundation This work is available under the Creative Commons SA 2.5 license The OWASP Foundation OWASP Denver February 2012.
CSRF Attacks Daniel Chen 11/18/15. What is CSRF?  Cross Site Request Forgery (Sea-Surf)  AKA XSRF/ One Click / Sidejacking / Session Riding  Exploits.
Web Login, Cookies Web Login | Old way HTML
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.
CSC 482/582: Computer Security
Javascript worms By Benjamin Mossé SecPro
Web Application Vulnerabilities
An Introduction to Web Application Security
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
TOPIC: Web Security (Part-4)
Modeling User Interactions for (Fun and) Profit Preventing Request Forgery Attacks in Web Applications Karthick Jayaraman, Grzegorz Lewandowski, Paul G.
World Wide Web policy.
Security in Django.
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
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
WWW安全 國立暨南國際大學 資訊管理學系 陳彥錚.
Active Man in the Middle Attacks
Cross Site Request Forgery New Attacks and Defenses
Cross-Site Scripting Issues and Defenses Ed Skoudis Predictive Systems
Advanced Cross Site Scripting Evil XSS
Cross Site Request Forgery (CSRF)
Presentation transcript:

Ofer Shezaf, CTO, Breach Security ofers@breach.com CSRF Basics Ofer Shezaf, CTO, Breach Security ofers@breach.com

Same Origin Policy bank.com blog.net document, cookies Part of the sandbox which forms the basic Web security. A “browser window” can access only the site from which it was fetched, sandboxing two applications one for the other. XHR TAG XHR TAG JS blog.net document, cookies

Attacks Against Same Origin Policy Malware – a malicious software is installed on the victim’s computer: Full control of the victim’s computer. No vulnerability necessary. Browser Bug – victim’s browser (or related software) is unpatched: Level of cross domain risk depends on the specific bug. In many cases allows full control of victim’s computer. Heavily used by Malware. XSS - Exploiting a server side vulnerability to run scripts in server’s context on victim’s browser. Effectively breaks same origin policy for vulnerable site (and others that might trust it). Easy to mitigate if input is normally simple (i.e. no tags in input). CSRF - ???

What is Cross Site Request Forgery (CSRF)? Sending requests to other applications is not controlled by same origin policy. Only receiving results! This allows an attacker to perform actions within the victim’s authenticated session. Go to Transfer Assets https://bank.com/fn?param=1 Select Fund and Amount https://bank.com/fn?param=1 Submit Transaction (Credentials included!) https://bank.com/fn?param=1 JSESSIONID=AC934234…

How Does CSRF Work? Tags Autoposting Forms XmlHttpRequest <img src=“https://bank.com/fn?param=1”> <iframe src=“https://bank.com/fn?param=1”> <script src=“https://bank.com/fn?param=1”> Autoposting Forms <body onload="document.forms[0].submit()"> <form method="POST" action=“https://bank.com/fn”> <input type="hidden" name="sp" value="8109"/> </form> XmlHttpRequest

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 Severe impact on accountability Log entries reflect the actions a victim was tricked into executing

Requiring multi-step transactions Partial solutions Only accept POST Blocks 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 Attacker can: Use Flash to forge the referer. Techniques to selectively create HTTP request without referers exist. Makes attacks harder and can be a supporting mechanism. Might be valuable in controlled environments. Requiring multi-step transactions CSRF attack can perform each step in order. Still makes the attack much more complex.

Re-authentication - Better, but less useful… Re-authenticating for crucial action Must be atomic, i.e. performed together with the critical actions. A burden for users. Overuse of passwords tend to make them weaker: People choose simpler passwords, or write them down for the duration of the session. Captcha A better alternative to re-authentication from the usability stand-point. Many implementations known to be breakable. Still needs to be atomic

Tokens - Best, but… Adding a token or a signature to linkable elements to ensure proper flow: Cryptographically strong referrer. Requires a lot of tuning: Must be consistent from point of authentication. Deep linking, bookmarks must be taken into account. Many reference implementation, but not standard in frameworks yet: OWASP CRSFguard: http://www.owasp.org/index.php/CSRFGuard PHP CSRFGuard: http://www.owasp.org/index.php/PHP_CSRF_Guard JSCK: http://www.thespanner.co.uk/2007/10/19/jsck/

Enterprise CSRF Mitigation Strategy Balance Between Security, Usability, and Cost Challenge Response One-Time Token CAPTCHA Transaction Signing Unique Request Tokens Unique URL Token Worth the time and money? Mission Critical Functions Everyday Business functions How do organizations with various development groups consisting of ‘cowboy’ developers mitigate this problem throughout? Ans: It’s a balance act that requires a well defined strategy Some solutions are bullet-proof in theory but greatly hinder the usability of the application Some solutions are strong, but fail in certain scenarios Our Strategy: Gather information on all development groups: what technologies, what applications? Use this opportunity to raise awareness of the issue Assess the risk associated with each of the applications in each development group and PRIORITIZE WHAT APPS AND BUSINESS FUNCTIONS NEED TO BE PROTECTED Implement a ‘visible but transparent’ solution that can be incorporated into each development group. Things to consider… Does the technology utilized by the dev group facilitate the ‘drop, configure, deploy’ approach ? (i.e. J2EE, .NET) Are there actual code changes to the applications that must take place? How much time, effort, and money needs to be spent to implement this solution? How are we affecting the usability of our application? Plan time for testing! Some application code changes will be significant! Go over graph: ‘Mission Critical vs. Everyday vs. Lunch Menu’ Lunch Menu Functions

Main Point Any remaining questions that we haven’t addressed yet? Teaching Points If you have any questions about application security, please don’t hesitate to call me or send an email. I’d be happy to help you work it out. Examples, Demonstrations, Stories, Notes Thanks to Eric Sheridan, who’s presentation at OWASP San Jose 2007 is the base for this one: http://www.owasp.org/images/c/c9/CSRF_DangerDetectionDefenses.ppt Also see: http://www.owasp.org/index.php/Cross-Site_Request_Forgery http://www.cgisecurity.com/articles/csrf-faq.shtml