WHY CSRF WORKS. Implicit authentication by Web browsers

Similar documents
Cross-Site Request Forgery: The Sleeping Giant. Jeremiah Grossman Founder and CTO, WhiteHat Security

How to Configure SSL VPN Portal for Forcepoint NGFW TECHNICAL DOCUMENT

RKN 2015 Application Layer Short Summary

Preparing for the Cross Site Request Forgery Defense

CS 142 Winter Session Management. Dan Boneh

Advanced Web Technology 10) XSS, CSRF and SQL Injection

Uniform Resource Locators (URL)

Web Application Security. Philippe Bogaerts

COMP9321 Web Application Engineering

Computer Security 3e. Dieter Gollmann. Chapter 18: 1

Combating Common Web App Authentication Threats

Web basics: HTTP cookies

Lecture 17 Browser Security. Stephen Checkoway University of Illinois at Chicago CS 487 Fall 2017 Some slides from Bailey's ECE 422

How is state managed in HTTP sessions. Web basics: HTTP cookies. Hidden fields (2) The principle. Disadvantage of this approach

PROBLEMS IN PRACTICE: THE WEB MICHAEL ROITZSCH

Common Websites Security Issues. Ziv Perry

Abusing Windows Opener to Bypass CSRF Protection (Never Relay On Client Side)

WEB SECURITY: XSS & CSRF

Lecture Overview. IN5290 Ethical Hacking

Lecture 6: Web hacking 2, Cross Site Scripting (XSS), Cross Site Request Forgery (CSRF), Session related attacks

Sichere Software vom Java-Entwickler

Web basics: HTTP cookies

Welcome to the OWASP TOP 10

NoScript, CSP and ABE: When The Browser Is Not Your Enemy

More attacks on clients: Click-jacking/UI redressing, CSRF

Solutions Business Manager Web Application Security Assessment

Some Facts Web 2.0/Ajax Security

Attacking the Application OWASP. The OWASP Foundation. Dave Ferguson, CISSP Security Consultant FishNet Security.

Attacks Against Websites. Tom Chothia Computer Security, Lecture 11

COMP9321 Web Application Engineering

CSC 482/582: Computer Security. Cross-Site Security

Web Security: Vulnerabilities & Attacks

CSCD 303 Essential Computer Security Fall 2018

EasyCrypt passes an independent security audit

ESORICS September Martin Johns

2/16/18. CYSE 411/AIT 681 Secure Software Engineering. Secure Coding. The Web. Topic #11. Web Security. Instructor: Dr. Kun Sun

CSCD 303 Essential Computer Security Fall 2017

COMP9321 Web Application Engineering

The PKI Lie. The OWASP Foundation Attacking Certificate Based Authentication. OWASP & WASC AppSec 2007 Conference

OWASP Thailand. Proxy Caches and Web Application Security. OWASP AppSec Asia October 21, Using the Recent Google Docs 0-Day as an Example

CIS 4360 Secure Computer Systems XSS

CSE361 Web Security. Attacks against the client-side of web applications. Nick Nikiforakis

Cross-Site Request Forgery (CSRF) Attack Lab

COSC 301 Network Management. Lecture 15: SSL/TLS and HTTPS

GOING WHERE NO WAFS HAVE GONE BEFORE

WEB SECURITY WORKSHOP TEXSAW Presented by Solomon Boyd and Jiayang Wang

Client Side Injection on Web Applications

SECURING APACHE : ATTACKS ON SESSION MANAGEMENT

Founded the web application security lab

Information Security CS 526 Topic 11

LECT 8 WEB SECURITY BROWSER SECURITY. Repetition Lect 7. WEB Security

Andrew Muller, Canberra Managing Director, Ionize, Canberra The challenges of Security Testing. Security Testing. Taming the Wild West

Application vulnerabilities and defences

2/16/18. Secure Coding. CYSE 411/AIT 681 Secure Software Engineering. Web Security Outline. The Web. The Web, Basically.

Authentication and Password CS166 Introduction to Computer Security 2/11/18 CS166 1

How to Configure Authentication and Access Control (AAA)

BIG-IP Access Policy Manager : Portal Access. Version 12.1

Application Security through a Hacker s Eyes James Walden Northern Kentucky University

Web 2.0 and AJAX Security. OWASP Montgomery. August 21 st, 2007

Web Security. Thierry Sans

PROBLEMS IN PRACTICE: THE WEB MICHAEL ROITZSCH

OWASP Top 10 Risks. Many thanks to Dave Wichers & OWASP

F5 Big-IP Application Security Manager v11

A Server- and Browser-Transparent CSRF Defense for Web 2.0 Applications

P2_L12 Web Security Page 1

Attacks Against Websites 3 The OWASP Top 10. Tom Chothia Computer Security, Lecture 14

Robust Defenses for Cross-Site Request Forgery Review

Web Security. Course: EPL 682 Name: Savvas Savva

October 08: Introduction to Web Security

s642 web security computer security adam everspaugh

CS 161 Computer Security

Provide you with a quick introduction to web application security Increase you awareness and knowledge of security in general Show you that any

Security and Privacy. SWE 432, Fall 2016 Design and Implementation of Software for the Web

Information Security CS 526 Topic 8

Your Turn to Hack the OWASP Top 10!

Progress Exchange June, Phoenix, AZ, USA 1

ISSA: EXPLOITATION AND SECURITY OF SAAS APPLICATIONS. Waqas Nazir - CEO - DigitSec, Inc.

Cross Site Request Forgery

High -Tech Bridge s Web Server Security Service API Developer Documentation Version v1.3 February 13 th 2018

Chrome Extension Security Architecture

Web Security II. Slides from M. Hicks, University of Maryland

Certified Secure Web Application Engineer

Application Security Introduction. Tara Gu IBM Product Security Incident Response Team

OWASP TOP 10. By: Ilia

The three faces. DeepSec Martin Johns University of Hamburg Universität Hamburg

86% of websites has at least 1 vulnerability and an average of 56 per website WhiteHat Security Statistics Report 2013

CNIT 129S: Securing Web Applications. Ch 3: Web Application Technologies

Tabular Presentation of the Application Software Extended Package for Web Browsers

Robust Defenses for Cross-Site Request Forgery

CSWAE Certified Secure Web Application Engineer

Care & Feeding of Programmers: Addressing App Sec Gaps using HTTP Headers. Sunny Wear OWASP Tampa Chapter December

Web Attacks Lab. 35 Points Group Lab Due Date: Lesson 16

Hacking Intranet Websites from the Outside

Create and Apply Clientless SSL VPN Policies for Accessing. Connection Profile Attributes for Clientless SSL VPN

Domino Web Server Security

Scan Report Executive Summary

Kishin Fatnani. Founder & Director K-Secure. Workshop : Application Security: Latest Trends by Cert-In, 30 th Jan, 2009

Ethical Hacking and Countermeasures: Web Applications, Second Edition. Chapter 3 Web Application Vulnerabilities

CS 161 Computer Security

Computer Security CS 426 Lecture 41

Transcription:

WHY CSRF WORKS To explain the root causes of, and solutions to CSRF attacks, I need to share with you the two broad types of authentication mechanisms used by Web applications: 1. Implicit authentication 2. Explicit authentication Implicit authentication by Web browsers Implicit authentication by Web browsers occurs when the browser automatically includes authentication information in HTTP requests; in other words, the Web browser itself is responsible for tracking the authenticated state. Widely used implicit authentication mechanisms in the browser include: HTTP authentication:this enables the Web server to request authentication credentials from the browser in order to restrict access to certain Web pages. In all the three methods (basic, digest and NTLM), the initial authentication process undergoes the same basic steps. Figure 3 shows a simplified version of the authentication process. If the client requests further restricted resources that lie in the same authentication realm, the browser includes the credentials automatically in the request.

Figure 3: Typical HTTP authentication Cookies:Web browser cookie technology provides persistent data storage on the client side, which is often used by today s Web applications to store authentication tokens. After a successful login procedure, the server sends a cookie to the client. Every subsequent HTTP request that contains this cookie is automatically regarded as authenticated. The typical cookie authentication process is shown in Figure 4.

Figure 4: Typical cookie authentication Client-side SSL authentication: The Secure Socket Layer (SSL), and its successor, the Transport Layer Security (TLS) protocol, enable cryptographically authenticated communication between the Web browser and the Web server. To authenticate, X.509 certificates and digital signature schemes are used. What all these schemes have in common is that after a successful initial authentication, tokens are sent automatically in further requests, without asking the user for permission this is what makes Web applications that use these authentication techniques, vulnerable to CSRF attacks.

Implicit authentication by IP address This special case of implicit authentication is often found on intranets. Here, the authentication is based on certain IP (or MAC) addresses from which requests are made to the application. Shown in Figure 5 is a typical IP-based authentication, in which only users within the intranet are allowed to access the intranet server, and requests from all other IP addresses are denied access. Figure 5: Typical IP-based authentication

Explicit authentication is safer In this type of authentication, the Web application (or the Web server) is itself responsible for tracking the authenticated state of the user. This is generally done in two ways: a. URL rewriting, in which the session tokens are included in the URL for every request sent to the server; the URL is generated by the Web application/web server, and does not require the browser to pass authentication tokens along with the request. b. Form-based session tokens, in which hyperlinks are replaced with HTML forms that contain session identifiers in hidden form fields. Though explicit authentication is immune to CSRF, it has other problems, which we will discuss in a while. The main reason that CSRF works is that Web applications using implicit authentication mechanisms do not verify that a state-changing request was created within the Web application. Because of the implicit authentication of the user, the attacker can easily control the user s session. Another underlying factor that enables CSRF attacks is the application s use of predictable URL/form actions in a repeatable way. Some myths about CSRF Myths CSRF is just a special case of XSS Facts XSRF is a separate vulnerability from XSS, with a different solution. XSS protection won t stop XSRF attacks, though it is also important to

Some myths about CSRF Myths Facts guard against XSS on a priority basis. Applications aren t vulnerable to CSRF if they use multi page forms to perform actions. CSRF is solvable by forcing all sensitive requests over POST while denying GETs. CSRF can be prevented by filtering based on the referrer header. While multi page forms certainly make exploitation harder, attackers usually can exploit them. Attackers frequently use multiple IFRAMEs when building multi page form CSRF exploits. While POSTs can be more difficult to exploit, they certainly are exploitable, as shown in Scenario 1. Using POST rather than GET can provide a defense only against local CSRF attacks; POST requests can still be created with hidden IFRAMEs on foreign Web pages. Forms can mislead users about what they are sending, and where, and scripting can lead to automatic submission. JavaScript is fully capable of sending POST requests via form submissions. This option is very unreliable, since attackers can easily block the sending of the referrer header, through the use of certain browser and Flash exploits. Some browsers also omit the referrer header when they are being used over SSL. Moreover, many firewalls and anti-spyware software often drop referrers, in their default

Some myths about CSRF Myths Facts mode, without letting users know. But, using referrers can be viewed as another incremental roadblock. Browser enforcement of Same Origin Policy (SOP) prevents CSRF. Browsers that implement SOP will prevent scripts from accessing the DOM of a page originating from another domain, or accessing cookies that originate from other domains. However, they do not prevent scripts from sending requests to other domains. Furthermore, when a script sends a request to another domain (or when an IMG tag s SRC attribute is set to another domain), the browser will execute the request, and will also send any cookies it has that are valid for the domain, along with the request. (See the following highlight on SOP). Sane Origin Policy (SOP): Web browsers use a security model called the same origin policy (SOP) to enforce some access restrictions on Web applications. The SOP identifies each website using its origin, which is a unique combination of protocol, domain and port, and creates a context for each origin. Two resources are considered to be of the same origin only if all these values are exactly the same.