Understanding SharePoint 2013 Add-In Security Vulnerabilities

Slides:



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

Nick Feamster CS 6262 Spring 2009
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.
Don’t get Stung (An introduction to the OWASP Top Ten Project) Barry Dorrans Microsoft Information Security Tools NEW AND IMPROVED!
©2009 Justin C. Klein Keane PHP Code Auditing Session 5 XSS & XSRF Justin C. Klein Keane
Common Exploits Aaron Cure Cypress Data Defense. SQL Injection.
An Evaluation of the Google Chrome Extension Security Architecture
EECS 354 Network Security Cross Site Scripting (XSS)
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.
ASP.NET 2.0 Chapter 6 Securing the ASP.NET Application.
Microsoft ® Official Course Developing Remote-hosted Apps for SharePoint Microsoft SharePoint 2013 SharePoint Practice.
Migrating Full-Trust Solutions to the Cloud Scot
CROSS SITE SCRIPTING..! (XSS). Overview What is XSS? Types of XSS Real world Example Impact of XSS How to protect against XSS?
Handling Security Threats in Kentico CMS Karol Jarkovsky Sr. Solution Architect Kentico Software
SPC204 Security Problems in SharePoint 2010 Authentication and Authorization.
Introduction to InfoSec – Recitation 10 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
Session 11: Security with ASP.NET
HTTP and Server Security James Walden Northern Kentucky University.
CSCD 303 Essential Computer Security Winter 2014 Lecture 12 – XSS, SQL Injection and CRSF Reading: See links - End of Slides.
Origins, Cookies and Security – Oh My! John Kemp, Nokia Mobile Solutions.
@ScotHillier Studies/SearchResult.aspx?q=hillier.
Prevent Cross-Site Scripting (XSS) attack
WEB SECURITY WEEK 3 Computer Security Group University of Texas at Dallas.
CSCI 6962: Server-side Design and Programming Secure Web Programming.
Lecture 14 – Web Security SFDV3011 – Advanced Web Development 1.
Web Application Access to Databases. Logistics Test 2: May 1 st (24 hours) Extra office hours: Friday 2:30 – 4:00 pm Tuesday May 5 th – you can review.
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.
November 13, 2008 Ohio Information Security Forum Attack Surface of Web Applications James Walden Northern Kentucky University
©2008 Gotham Digital Science Secure Parameter Filter (SPF) (AKA Protecting Vulnerable Applications with IIS7) Justin Clarke, Andrew Carey Nairn.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Securing a Microsoft ASP.NET Web Application.
Chapter 8 Cookies And Security JavaScript, Third Edition.
Srikar Nadipally. Outline Finding and Exploiting XSS Vulnerabilities Standard Reflected XSS Stored XSS DOM based XSS Prevention of XSS attack Reflect.
Cross-Site Attacks James Walden Northern Kentucky University.
Top Five Web Application Vulnerabilities Vebjørn Moen Selmersenteret/NoWires.org Norsk Kryptoseminar Trondheim
Session and Cookie Management in.Net Sandeep Kiran Shiva UIN:
October 3, 2008IMI Security Symposium Application Security through a Hacker’s Eyes James Walden Northern Kentucky University
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.
Building Secure Web Applications With ASP.Net MVC.
Web Security SQL Injection, XSS, CSRF, Parameter Tampering, DoS Attacks, Session Hijacking SoftUni Team Technical Trainers Software University
Copyright © The OWASP Foundation Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation.
THE DEVIL IS IN THE (IMPLEMENTATION) DETAILS: AN EMPIRICAL ANALYSIS OF OAUTH SSO SYSTEMS SAN-TSAI SUN & KONSTANTIN BEZNOSOV PRESENTED BY: NAZISH KHAN COMPSCI.
University of Central Florida The Postman Always Rings Twice: Attacking & Defending postMessage in HTML5 Websites Ankur Verma University of Central Florida,
Web Security SQL Injection, XSS, CSRF, Parameter Tampering, DoS Attacks, Session Hijacking ASP.NET MVC SoftUni Team Technical Trainers Software University.
Web Security Lesson Summary ●Overview of Web and security vulnerabilities ●Cross Site Scripting ●Cross Site Request Forgery ●SQL Injection.
Web2.0 Secure Development Practice Bruce Xia
Securing Angular Apps Brian Noyes
UNDERSTANDING YOUR OPTIONS FOR CLIENT-SIDE DEVELOPMENT IN OFFICE 365 Mark Rackley
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-API & MVC5 - Identity & Security Mait Poska & Andres Käver, IT Kolledž 2014.
Redmond Protocols Plugfest 2016 Tarun Chopra Accessing APIs through Add-Ins Sr. Escalation Engineer.
SlideSet #20: Input Validation and Cross-site Scripting Attacks (XSS) SY306 Web and Databases for Cyber Operations.
SECURE DEVELOPMENT. SEI CERT TOP 10 SECURE CODING PRACTICES Validate input Use strict compiler settings and resolve warnings Architect and design for.
Web Security (cont.) 1. Referral issues r HTTP referer (originally referrer) – HTTP header that designates calling resource  Page on which a link is.
Building Secure ColdFusion Applications
Web Application Vulnerabilities
An Introduction to Web Application Security
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
API Security Auditing Be Aware,Be Safe
Migrating SharePoint Add-ins from Azure ACS to Azure AD
WEB-API & MVC5 - Identity & Security
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
Riding Someone Else’s Wave with CSRF
Agenda OAuth Concepts Programming OAuth.
WWW安全 國立暨南國際大學 資訊管理學系 陳彥錚.
Cross Site Request Forgery (CSRF)
Presentation transcript:

Understanding SharePoint 2013 Add-In Security Vulnerabilities Scot Hillier scot@scothillier.net @ScotHillier

Scot Hillier scot@scothillier.net @ScotHillier

Apologizing in advance Out with the old… In with the new… Apps for SharePoint SharePoint Add-Ins App Web Add-In Web App Part Add-In Part SharePoint App Model SharePoint Add-In Model Apps for Office Office Add-Ins Office App Model Office Add-In Model

Agenda Man-in-the-Middle Cross Site Scripting Click Jacking Over Posting Cross Site Request Forgery

Man-in-the-Middle (MITM) An attack where communication between endpoints is intercepted. Primary defense Secure Sockets Layer (SSL) SharePoint add-in vulnerabilities OAuth tokens Sensitive data

Azure Active Directory OAuth 2.0 Office 365 Actors Azure Web Site (Client) End User (Resource Owner) Azure Active Directory (Authorization Server) SharePoint Online (Resource Server)

OAuth 2 Bearer Tokens Access Token Refresh Token A token passed to the Resource Server authorizing the Client to access resources Short-lived Refresh Token A token used to get an Access Token from the Authorization Server Requires passing the ClientSecret Long-lived

OAuth Tokens in Fiddler

Cross-Site Scripting (XSS) An attack where client-side script is injected into a page Classically where a form is submitted and the values displayed in a subsequent page Primary defenses ASP.NET request validation Set AntiXSS as default encoder Use “HTTP-only” cookies SharePoint add-in vulnerabilities Disabling ASP.NET request validation JavaScript encoding

Classic XSS <script runat="server">     protected void Button_Click(object sender, EventArgs e){         Label1.Text = TextBox1.Text;     } </script> <form runat="server">     <asp:TextBox id="TextBox1" runat="server"/>     <asp:Button onclick="Button_Click" runat="server"/> </form> <asp:Label id="Label1" runat="server"/>

ASP.NET Request Validation Prevents server from receiving unencoded HTML Throws an error when unecoded HTML is detected Disabling request validation ASP.NET Web Forms page <%@ Page validateRequest="false" %> ASP.NET MVC method attribute [AllowHtml] Application web.config <pages validateRequest="false"/> Encoding values in application Classically HtmlEncode and HtmlDecode methods Uses “black list” method to encode only certain dangerous characters

Classic Cross-Site Scripting and cookies

AntiXSS Library Included in ASP.NET 4.5 only encoder in ASP.NET 5 Uses a “white list” approach based on intended use HtmlEncode, CSSEncode, JavaScriptStringEncode, etc Use for all external data, not just forms Can be set as the default for your application in web.config <httpRuntime targetFramework="4.5"  encoderType="System.Web.Security.AntiXss.AntiXssEncoder,System.Web,   Version=4.0.0.0,  Culture=neutral,  PublicKeyToken=b03f5f7f11d50a3a" />

HTTP-Only Cookies A cookie only usable by the server Mitigates damage when a cookie is stolen Set for all cookies in application in web.config Create an individual cookie on the server <httpCookies httpOnlyCookies="true"/> HttpCookie myHttpOnlyCookie = new HttpCookie(); myHttpOnlyCookie.HttpOnly = true; myHttpOnlyCookie.Name = "MyHttpOnlyCookie"; Response.AppendCookie(myHttpOnlyCookie);

Http-only cookies

Click Jacking An attack where a malicious div floats above the target site. Show target site in IFRAME Float malicious DIV above it Primary defense Emit the header "X-FRAME-OPTIONS“ set to "DENY" or "SAMEORIGIN" SharePoint add-in vulnerabilities Add-In Parts General web vulnerability

X-FRAME-OPTIONS Prevents your content from being displayed in an IFRAME DENY or SAMEORIGIN Return the header in code Add code to Global.asax for entire add-in Add the header to IIS for all add-ins HttpContext.Response.AddHeader("X-Frame-Options", "DENY");

Click Jacking

Over Posting An attack where more data than required is POSTed. User must have permissions to POST to the original source User POSTs additional data that is contained in the data source Primary defense Use ASP.NET view models with only required properties Split SharePoint lists SharePoint add-in vulnerabilities SharePoint APIs Add-In-only privileges

Vulnerable SharePoint Lists <FieldRef ID="{fa564e0f-0c70-4ab9-b863-0177e6ddd247}" Name="Title" /> <FieldRef ID="{4a722dd4-d406-4356-93f9-2550b8f50dd0}" Name="FirstName" /> <FieldRef ID="{fce16b4c-fe53-4793-aaab-b4892e736d15}" Name="Email" /> <FieldRef ID="{fd630629-c165-4513-b43c-fdb16b86a14d}" Name="WorkPhone" /> <FieldRef ID="{b09f3922-a268-4a30-81da-6564b00745ed}" Name="RaisePercentage" />

Over Posting

Cross-Site Request Forgery (CSRF) An attack where domain cookies are leveraged. Link on malicious site invokes operation in your add-in Cookies automatically posted back to the domain Primary defense Implement an anti-forgery token SharePoint add-in vulnerabilities APIs are protected by RequestDigest token ASP.NET Anti-Forgery Token

Request Digest Token executor.executeAsync({ url: appWebUrl + "/_api/web/lists/getbytitle('Employees')/items",     method: "POST",     body: requestBody,     headers: {         "content-type": "application/json",         "accept": "application/json",         "content-length": requestBody.length,         "X-RequestDigest": jQuery("#__REQUESTDIGEST").val() }

CSRF

Agenda Man-in-the-Middle Cross Site Scripting Click Jacking Over Posting Cross Site Request Forgery

Questions? Thank you!