THE DEPUTIES ARE STILL CONFUSED RICH LUNDEEN



Similar documents
Finding and Preventing Cross- Site Request Forgery. Tom Gallagher Security Test Lead, Microsoft

OpenID Single Sign On and OAuth Data Access for Google Apps. Ryan Dave Primmer May 2010

Identity Management with Spring Security. Dave Syer, VMware, SpringOne 2011

Gateway Apps - Security Summary SECURITY SUMMARY

Next Generation Clickjacking

How To Use Salesforce Identity Features

Identity Federation: Bridging the Identity Gap. Michael Koyfman, Senior Global Security Solutions Architect

Criteria for web application security check. Version

AccountView. Single Sign-On Guide

A Server and Browser-Transparent CSRF Defense for Web 2.0 Applications. Slides by Connor Schnaith

Security Testing with Selenium

Configuration Guide - OneDesk to SalesForce Connector

Single Sign-On for the Internet: A Security Story. Eugene Tsyrklevich eugene@tsyrklevich.name Vlad Tsyrklevich vlad902@gmail.com

Single Sign On. SSO & ID Management for Web and Mobile Applications

Preparing for the Cross Site Request Forgery Defense

Single-Sign-On between On-Premises and the Cloud: Leveraging Windows Azure Active Directory to authenticate custom solutions and Apps

SAP: Session (Fixation) Attacks and Protections

Using SAML for Single Sign-On in the SOA Software Platform

Identity Implementation Guide

Web Application Hacking (Penetration Testing) 5-day Hands-On Course

Check list for web developers

Hack Proof Your Webapps

Social Application Guide

Identity Management in Liferay Overview and Best Practices. Liferay Portal 6.0 EE

How To Manage Your Web 2.0 Account On A Single Sign On On A Pc Or Mac Or Ipad (For A Free) On A Password Protected Computer (For Free) (For An Ipad) (Free) (Unhack)

Secure Programming Lecture 12: Web Application Security III

Computer Systems Security 2013/2014. Single Sign-On. Bruno Maia Pedro Borges

Logout Support on SP and Application

TIBCO Spotfire Platform IT Brief

HACKING AUTHENTICATION CHECKS IN WEB APPLICATIONS ASHISH RAO & SIDDHARTH ANBALAHAN

How to break in. Tecniche avanzate di pen testing in ambito Web Application, Internal Network and Social Engineering

Workday Mobile Security FAQ

SESSION IDENTIFIER ARE FOR NOW, PASSWORDS ARE FOREVER

Mobile Security. Policies, Standards, Frameworks, Guidelines

What is Web Security? Motivation

Working with Structured Data in Microsoft Office SharePoint Server 2007 (Part1): Configuring Single Sign On Service and Database

WEB SECURITY CONCERNS THAT WEB VULNERABILITY SCANNING CAN IDENTIFY

Hosted Connecting Steps Client Installation Instructions

MYOB EXO BUSINESS WHITE PAPER

OWASP and OWASP Top 10 (2007 Update) OWASP. The OWASP Foundation. Dave Wichers. The OWASP Foundation. OWASP Conferences Chair

The Password Problem Will Only Get Worse

Architectural Design Patterns. Design and Use Cases for OWASP. Wei Zhang & Marco Morana OWASP Cincinnati, U.S.A.

THE NEW DIGITAL EXPERIENCE

SSO Methods Supported by Winshuttle Applications

Adding Value to Automated Web Scans. Burp Suite and Beyond

State of The Art: Automated Black Box Web Application Vulnerability Testing. Jason Bau, Elie Bursztein, Divij Gupta, John Mitchell

Secure Single Sign-On

JVA-122. Secure Java Web Development

STABLE & SECURE BANK lab writeup. Page 1 of 21

Safewhere*Identify 3.4. Release Notes

Binary Bug - Automatic Binary Trading

Web-Application Security

BASELINE SECURITY TEST PLAN FOR EDUCATIONAL WEB AND MOBILE APPLICATIONS

3. Broken Account and Session Management. 4. Cross-Site Scripting (XSS) Flaws. Web browsers execute code sent from websites. Account Management

Secure Coding in Node.js

RTCWEB Generic Identity Service

Secure Coding SSL, SOAP and REST. Astha Singhal Product Security Engineer salesforce.com

OAuth Web Authorization Protocol Barry Leiba

Web Application Guidelines

Multi Factor Authentication API

Single Sign-on (SSO) technologies for the Domino Web Server

Using Foundstone CookieDigger to Analyze Web Session Management

Office 365 deploym. ployment checklists. Chapter 27

CSE 135 Server Side Web Languages Lecture # 7. State and Session Management

Device-Centric Authentication and WebCrypto

skype ID: store.belvg US phone number:

Web application security

(WAPT) Web Application Penetration Testing

Essential IT Security Testing

Introduction and overview view of Citrix ShareFile provisioning. Preparing your Citrix ShareFile account for provisioning

Egnyte Single Sign-On (SSO) Installation for OneLogin

External Network & Web Application Assessment. For The XXX Group LLC October 2012

CSE598i - Web 2.0 Security OWASP Top 10: The Ten Most Critical Web Application Security Vulnerabilities

Top Ten Web Application Vulnerabilities in J2EE. Vincent Partington and Eelco Klaver Xebia

OAuth: Where are we going?

Bug Report. Date: March 19, 2011 Reporter: Chris Jarabek

Access your Insurance Agent s web site using the URL the agency has provided you. Click on the Service 24/7 Link.

The Devil is Phishing: Rethinking Web Single Sign On Systems Security. Chuan Yue USENIX Workshop on Large Scale Exploits

Application Layer Encryption: Protecting against Application Logic and Session Theft Attacks. Whitepaper

Conducting Web Application Pentests. From Scoping to Report For Education Purposes Only

ArcGIS Server Security Threats & Best Practices David Cordes Michael Young

Security vulnerabilities in new web applications. Ing. Pavol Lupták, CISSP, CEH Lead Security Consultant

An Insight into Cookie Security

Single Log-Out. Andreas Åkre Solberg Malaga, June 2009

Configure Single Sign on Between Domino and WPS

Web Applica+on Security: Be Offensive! About Me

skype ID: store.belvg US phone number:

Q&A Session for Understanding Atrium SSO Date: Thursday, February 14, 2013, 8:00am Pacific

SINGLE & SAME SIGN-ON ASPECTS

Web Single Sign- On: OpenID, Shibboleth, and friends COSC412

Sichere Webanwendungen mit Java

MatriXay WEB Application Vulnerability Scanner V Overview. (DAS- WEBScan ) The best WEB application assessment tool

Is Drupal secure? A high-level perspective on web vulnerabilities, Drupal s solutions, and how to maintain site security

Transcription:

THE DEPUTIES ARE STILL CONFUSED RICH LUNDEEN

Hi my name is Rich I have a twi1er @webstersprodigy I have a website h1p://webstersprodigy.net

What is the same origin policy? Simple answer: content from one website should not (usually) be able to access or modify content on another website Even with frames, tabs, etc. A lot of web vulnerabiliges happen when websites inadvertently allow cross site access Crypto Rule #1 never invent your own Does this rule apply to all security? Unfortunately, this is easier said than done... (for crypto too)

Between the browser tabs Advanced CSRF A1acks Forcing cookies OAuth Other interesgng issues Clickjacking BeEf clickjacking module X- FRAME- OPTIONs Edge Cases

CSRF: Detectability Easy

Cookie Forcing CSRF There are tons of quirks to the same origin policy It s possible to GET or POST to any domain (basis for tradigonal CSRF) Lesser known: wrigng cookies is o]en much easier than reading them

Recap: WriGng Cookies Some reference: Sze Chuen Tan

Recap: WriGng Cookies From pr.bank.com we can set a cookie with name: csrf_token value: is_swear_this_is_a_nonce domain:.bank.com secure.bank.com would now receive the cookie

Recap: WriGng Cookies Can h1ps://secure.bank.com differengate between cookies it sets vs. cookies set from h1p://pr.bank.com?

Recap: WriGng Cookies Web frameworks most o]en (almost always) take the first cookie value when mulgple cookies are given with the same name h1p://securebank.com can overwrite cookies for h1ps://securebank.com (no duplicate cookies) All browsers have a limit to the number of cookies in the cookie jar It s common to add or modify cookies based on the DOM or request (cookie injecgon)

Recap: WriGng Cookies To drill this in, it s o]en possible to write cookies, even though reading them is hard: XSS in a neighbor domain MiTM (usually even with HSTS) Cookie injecgon

Double Submit Cookies

Cookies Apply to other CSRF Things! What is the CSRF token Ged to? The CSRF token must be Ged to something unique, or one user can replay another user s informagon This is usually a session cookie, or somegmes (worse) a stagc piece of informagon like a userid What if the framework Ges the CSRF token to the default sessionid, but then custom auth is used? This is most common with custom auth or stateless apps

.NET MVC CSRF ProtecGon This is very good It checks: sessiontoken is correct The cookie is Ged to the POST parameter The token is Ged to the user The user is properly logged in An expiragon But... Where does the user/session come from???

.NET MVC CSRF ProtecGon MVC CSRF protecgon works fine by default. The informagon is derived from the sessionid cookie automagcally The sessionid cookie is used to track users by default What if you auth another way?

demo.net MVC CSRF ProtecGon

Generically, what can we learn from this? Where is this most common? Custom auth with standard web framework Test methodology Much easier to test than exploit (but CSRF will break your heart) Figure out how the parameter nonce is Ged to a cookie, and replace the values between users Exploit Again: MiTM, cookie injecgon, neighbor XSS (in the demo we used neighbor XSS)

Let s look at other Frameworks Does this only apply to.net MVC? Of course not. Most languages/frameworks Ge CSRF miggagons to the default session The cookie tossing CSRF issue is most common when using custom authengcagon

Forms.NET

Non- Exploitable XSS I see this a lot But remember... we can frequently write cookies

Non- Exploitable XSS example Say an XSS exists in a CSRF protected POST request: h1p://customer.sharepoint.com/some_secgon/ vulnerablepage.aspx How could we exploit this? SharePoint disclaimer: This could equally apply to other places where we have cookie tossing SharePoint is a good/easy example, because by design you have script execugon in your separate domain a1acker.sharepoint.com

self- xss in xxx.sharepoint.com/some_secgon/ vulnerablepage.aspx User a1acker.sharepoint.com 1) set cookies as a1acker to sharepoint.com path= /some_secgon/vulnerablepage.aspx 2) Make POST request to /some_secgon/vulnerablepage.aspx as a1acker 3) Script execugng in the context of vicgm.sharepoint.com make request to /different/password.html (note cookie scope) vicgm.sharepoint.com

Single Sign On e.g. NTLM, Kerberos, Basic, etc. But mostly NTLM with extended protecgon or Kerberos, since the others have worse problems It should be obvious that this is so easy to get wrong. By it s nature, SSO auth is separate from cookies, but out- of- box CSRF miggagons must use cookies

OAuth2 and OpenID Facebook Login Diagram

OAuth2 What s the impact of CSRF here? h1p://stephensclafani.com/2011/04/06/oauth- 2-0- csrf- vulnerability/ h1p://sso- analysis.org/ CSRF MiGgaGons are covered in the spec itself state parameter should be used Non guessable value User agent s authengcated state Kept in a locagon accessible only to the client (i.e. cookies, protected by the same- origin policy)

Tying Accounts Together

A1ack Ideas The first a1ack I thought of: Toss cookies into vicgm (stackoverflow) The cookies used for auth may not be Ged to the nonce sent to the idengfier Associate the a1acker s account with the vicgm s account and win! But there are a lot of cookies for each site It turns out there s usually an easier way but the above will probably be a problem for a while

OAuth2 Facebook A1ack Create an a1acker Facebook account Grant the accessing applicagon (stackoverflow) permissions to a1acker Facebook VicGm is logged in to stackoverflow A malicious site does the following Logs vicgm in to a1acker s Facebook by using CSRF on the Login POSTs to the account associagon request A1acker Logs out of other sessions

demo OAuth2 A1ack

Logging into an A1acker Account To login to Facebook, the referer cannot be set There are several ways we can POST cross domain and strip the referer HTTPS - > HTTP (note HTTPS - > HTTPS does send the referer, even cross domain) CORS POST request <meta> refresh to data (kotowicz has a blog post on this)

OAuth2 A1ack

stackexchange is just an example Is this just stackexchange?... This is every applicagon I tested

woot.com

imdb.com

Logging out of A1acker Account

Hiding the CSRF ProtecGng against UI redressing is even in the spec, so just creagng a frame isn t ideal

A1ack RaGng The risk here is large let s look at that picture again O]en many ways to login Just ONE of these trusted idengfier sites is enough to take over an account FOREVER These can be hidden in the UI Once added, you o]en cannot even remove the logins, or the new account can remove old accounts No need to retype your old password!

A1ack RaGng Let s compare this to a classic XSS in a consumer page without using this? If I found an XSS in feedburner.google.com Would this ma1er for Google accounts? Probably not that much But this is really important for everyone who trusts google.com as an idengty provider

How do we fix this? Who s bug is this? It can be fixed on the consumer side state parameter properly Ged to the sessionid It seems not many people understand this, as not one applicagon I looked at did this Can it be fixed on the IDP side? If we make the idengty provider login CSRF proof, is this a non- issue? Separate the flow for login versus associate account? oauth a1ack against other id providers

Other Common CSRF Things Change the request method and remove the nonce the ispostback problem. set VIEWSTATE= try submisng CSRF nonce from another user Why not add a CSRF nonce to every request? Non- Changing Tokens The demos aren t excigng, but... the fired worker scenario

CSRF MiGgaGons Only use POST requests to change state, and all POST requests require an unguessable CSRF token CSRF tokens are cryptographically Ged to the session ID cookie (which must be Ged to auth) This goes for cross domain requests like OAuth too

Whitepaper Content Clickjacking NTLM Relaying

BeEf Clickjacking Module

X- FRAME- OPTIONS Edge Cases

That s all! Please complete the Speaker Feedback Surveys Here s my contact info again: h1p://webstersprodigy.net @webstersprodigy richard.lundeen@gmail.com