Automatic and Precise Client-Side Protection against CSRF Attacks

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
ForceHTTPS: Protecting High-Security Web Sites from Network Attacks Collin Jackson and Adam Barth.
HI-TEC 2011 SQL Injection. Client’s Browser HTTP or HTTPS Web Server Apache or IIS HTML Forms CGI Scripts Database SQL Server or Oracle or MySQL ODBC.
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.
Path Cutter: Severing the Self-Propagation Path of XSS JavaScript Worms in Social Web Networks Yinzhi Cao, Vinod Yegneswaran, Phillip Porras, and Yan Chen.
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)
Cross Site Scripting a.k.a. XSS Szymon Siewior. Disclaimer Everything that will be shown, was created for strictly educational purposes. You may reuse.
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.
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.
 Proxy Servers are software that act as intermediaries between client and servers on the Internet.  They help users on private networks get information.
Introduction to InfoSec – Recitation 10 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
Towards a Formal Foundation of Web Security devdatta akhawe / adam barth / peifung eric lam john mitchell / dawn song.
Copyright© 2002 Avaya Inc. All rights reserved Advanced Cross Site Scripting Evil XSS Anton Rager.
Cross-Site Scripting Vulnerabilities Adam Doupé 11/24/2014.
Origins, Cookies and Security – Oh My! John Kemp, Nokia Mobile Solutions.
Prevent Cross-Site Scripting (XSS) attack
Juha Siivikko SECURITY IN SOCIAL MEDIA.
WEB SECURITY WEEK 3 Computer Security Group University of Texas at Dallas.
Lecture 14 – Web Security SFDV3011 – Advanced Web Development 1.
Robust Defenses for Cross-Site Request Forgery CS6V Presented by Saravana M Subramanian.
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.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
3-Protecting Systems Dr. John P. Abraham Professor UTPA.
1 Internet Browsing Vulnerabilities and Security ECE4112 Final Lab Ye Yan Frank Park Scott Kim Neil Joshi.
Security Scanners Mark Shtern. Popular attack targets Web – Web platform – Web application Windows OS Mac OS Linux OS Smartphone.
Top Five Web Application Vulnerabilities Vebjørn Moen Selmersenteret/NoWires.org Norsk Kryptoseminar Trondheim
Robust Defenses for Cross-Site Request Forgery
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.
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the OWASP License. The OWASP.
Web Applications Testing By Jamie Rougvie Supported by.
Module 7: Advanced Application and Web Filtering.
Saphe surfing! 1 SAPHE Secure Anti-Phishing Environment Presented by Uri Sternfeld.
Protecting Browsers from Extension Vulnerabilities Paper by: Adam Barth, Adrienne Porter Felt, Prateek Saxena at University of California, Berkeley and.
Web Security Lesson Summary ●Overview of Web and security vulnerabilities ●Cross Site Scripting ●Cross Site Request Forgery ●SQL Injection.
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.
Carrie Estes Collin Donaldson.  Zero day attacks  “zero day”  Web application attacks  Signing up for a class  Hardening the web server  Enhancing.
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.
SlideSet #20: Input Validation and Cross-site Scripting Attacks (XSS) SY306 Web and Databases for Cyber Operations.
DOWeR Detecting Outliers in Web Service Requests Master’s Presentation of Christian Blass.
Javascript worms By Benjamin Mossé SecPro
Google’s Gruyere1 : An XSS Example Presented by: Terry Gregory
CSCE 548 Student Presentation Ryan Labrador
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.
CISC103 Web Development Basics: Web site:
Ofer Shezaf, CTO, Breach Security
Cross-Site Forgery
Cross-Site Request Forgeries: Exploitation and Prevention
Password Managers: Attacks and Defenses
Database Driven Websites
Riding Someone Else’s Wave with CSRF
WWW安全 國立暨南國際大學 資訊管理學系 陳彥錚.
Back end Development CS Programming Languages for Web Applications
Active Man in the Middle Attacks
Cross Site Request Forgery New Attacks and Defenses
Protecting Against Common Web Application Vulnerabilities
Cross-Site Scripting Issues and Defenses Ed Skoudis Predictive Systems
Client-Server Model: Requesting a Web Page
Advanced Cross Site Scripting Evil XSS
Exploring DOM-Based Cross Site Attacks
Back end Development CS Programming Languages for Web Applications
Cross Site Request Forgery (CSRF)
Presentation transcript:

Automatic and Precise Client-Side Protection against CSRF Attacks Philippe De Ryck, Lieven Desmet, Wouter Joosen, Frank Piessens Philippe.DeRyck@cs.kuleuven.be

Outline Cross-site Request Forgery (CSRF) Client-side Protection against CSRF Client-Side Request Filtering Request Filtering Policy Formal Evaluation Practical Evaluation Conclusion 13/11/2018

Cross-Site Request Forgery 13/11/2018

Cross-site Request Forgery Cross-site Request Forgery can be used to … take over your blog modify your YouTube account obtain your email address steal your money W. Zeller and E. Felten, Cross-site Request Forgeries: Exploitation and Prevention, Technical Report, October 2008 13/11/2018

Normal surfing scenario Open “My Insecure Bank” (GET www.mib.com) User (Browser) Web Server www.mib.com Some welcome page Login to the bank (POST www.mib.com/auth, user=Philippe, pass=bleh) Login successful (Set cookie) Execute wire transfer (POST www.mib.com/wt, to=000-0000001-01, amount=100) Wire transfer executed 13/11/2018

CSRF Attack Scenario Web Server www.mib.com Already authenticated with “My Insecure Bank” User (Browser) Execute wire transfer (POST www.mib.com/wt, to=000-0000001-01, amount=100) Wire transfer executed Web Server lolcats.com Browsing for LOLcats (GET lolcats.com/top10) Page of LOLcats with an embedded CSRF attack Continue “being productive” More LOLcats 13/11/2018

CSRF Payload <iframe id=“frame” style=“width=0px;height=0px;border=0px”></iframe> <script> var html = “”; html+ = “<form id=‘form’ method=‘post’ action=‘http://www.mib.com/wt’>”; html += “<input type=‘hidden’ name=‘to’ value=‘000-0000001-01’>”; html += “<input type=‘hidden’ name=‘amount’ value=‘99999’>”; html += “</form>”; document.getElementById(“frame”).contentDocument.body.innerHTML = html; document.getElementById(“form”).submit(); </script> 13/11/2018

Client-Side Protection against CSRF 13/11/2018

Client-Side Countermeasures (1) Several browser add-ons available Collect information from browser Make a decision for each request Mitigation: blocking or stripping request Examples: NoScript ABE Request Policy CsFire 13/11/2018

Client-Side Countermeasures (2) Current client-side countermeasures Affect each cross-origin request Very secure Negative impact on usability Experience from CsFire (33,000+ downloads) Limited impact on usability A few cross-origin scenarios break Currently addressed by central/local policies 13/11/2018

Cross-Origin Scenarios Examples: Payment Providers, Single sign-on Hard to distinguish Often look like CSRF attacks Intention of user/site is unknown Current status Broken by all client-side countermeasures Can be addressed using specific policy rules 13/11/2018

Cross-Origin Scenario – Payment 13/11/2018

Cross-Origin Scenario – SSO 13/11/2018

State of Client-Side Countermeasures CSRF Payment SSO NoScript ABE RequestPolicy CsFire < 1.0 13/11/2018

Client-side Request Filtering 13/11/2018

Idea behind the Client-side Policy Site A can delegate control to site B E.g. when B is a payment provider When B is finished, control is transferred back to A E.g. when the payment is complete and A needs to complete the transaction Detect delegation to B and allow B to return to A 13/11/2018

Idea behind the Client-side Policy (2) Strip all cross-origin requests unless it is an expected request A request from B to A is expected if A previously delegated to B Delegation from A to B occurs if A issues a POST request to B or if A redirects to B using a parametrized URI 13/11/2018

Delegation Illustrated Cross-Origin Parametrized Redirect Cross-Origin POST 13/11/2018

Assumption of Delegation Can an attacker delegate control? POST request By form submission or using XHR Requires script injection (which trumps CSRF) Parametrized Redirect By injecting server-side code (total compromise) Using an open redirect (direct attack possible, so no point in using a delegation and expected request) Limit expected requests to single GET 13/11/2018

State from Previous Request Client-side Policy State from Previous Request Redirect? no yes yes sameOrigin(ctx,dst) sameOrigin(last,dst) no no Expected? yes yes no State from Origin No State 13/11/2018

Cross-Origin Scenario – Payment 13/11/2018

Cross-Origin Scenario – SSO 13/11/2018

Cross-Origin Scenario – Attacks 13/11/2018

Formal Evaluation Formal model of policy Analysis results First for client-side CSRF countermeasure Gives strong security guarantees Base model by Akhawe et al. [1] Analysis results Bounded scope: 9 HTTP events, 4 origins, … No CSRF scenarios found Functional scenarios are possible [1] Devdatta Akhawe, Adam Barth, Peifung E. Lam, John Mitchell, and Dawn Song. Towards a formal foundation of web security. Computer Security Foundations. Symposium, IEEE, 0:290–304, 2010. 13/11/2018

Practical Evaluation Implementation as extension of CsFire Tested against benchmark of CSRF scenarios Different attack vectors: HTML, CSS, JS, redirect, … Tested on real-life functional scenarios 13/11/2018

State of Client-Side Countermeasures CSRF Payment SSO NoScript ABE RequestPolicy CsFire < 1.0 CsFire >= 1.0 13/11/2018

Evaluating Delegation in Real-Life Traffic Only two cases with unverifiable delegation In Total: 0.0042% of origins Redirecting search engines (6.05 % of requests) URL shorteners (1.37 % of requests) Category % of requests Third Party Service Mashups 52.95% Multi-Origin Websites 25.27% Content Aggregators 14.97% URL Shorteners 1.37% False Positives 2.20% Others (unclassified) 3.24% Total number of delegations 100.00% 13/11/2018

Conclusion 13/11/2018

Conclusion Client-side CSRF countermeasure Delegation between sites Improved balance usability and security Support for cross-origin collaborations Formal evaluation of the policy Delegation between sites Experimentally evaluated Minor compromise on security 13/11/2018

CsFire – Mozilla Add-Ons 13/11/2018