Warning Ahead: Security Storms are Brewing in Your JavaScript Yuval Idan, Technical Director, APAC Checkmarx

Slides:



Advertisements
Similar presentations
Protecting Browser State from Web Privacy Attacks Collin Jackson, Andrew Bortz, Dan Boneh, John Mitchell Stanford University.
Advertisements

WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Creating Stronger, Safer, Web Facing Code JPL IT Security Mary Rivera June 17, 2011.
An Evaluation of the Google Chrome Extension Security Architecture
EECS 354 Network Security Cross Site Scripting (XSS)
AppSec USA 2014 Denver, Colorado Warning Ahead: Security Storms are Brewing in Your JavaScript Helen Bravo.
Warning Ahead: Security Storms are Brewing in Your JavaScript Maty Siman.
Server-Side vs. Client-Side Scripting Languages
ASP.NET 2.0 Chapter 6 Securing the ASP.NET Application.
 Proxy Servers are software that act as intermediaries between client and servers on the Internet.  They help users on private networks get information.
CROSS SITE SCRIPTING..! (XSS). Overview What is XSS? Types of XSS Real world Example Impact of XSS How to protect against XSS?
Part or all of this lesson was adapted from the University of Washington’s “Web Design & Development I” Course materials.
Chapter 6: Hostile Code Guide to Computer Network Security.
WEB SECURITY WORKSHOP TEXSAW 2013 Presented by Joshua Hammond Prepared by Scott Hand.
Web Application Vulnerabilities Checklist. EC-Council Parameter Checklist  URL request  URL encoding  Query string  Header  Cookie  Form field 
 What I hate about you things people often do that hurt their Web site’s chances with search engines.
Web Services & Widgets Godmar Back. Mash-Ups Applications that combine information from different sources in one web page Different architectural choices.
Introduction to InfoSec – Recitation 10 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
1 Web Developer & Design Foundations with XHTML Chapter 6 Key Concepts.
Is Your Website Hackable? Check with Acunetix Web Vulnerability Scanner. Acunetix Web Vulnerability Scanner V9.
Josh
DHTML. What is DHTML?  DHTML is the combination of several built-in browser features in fourth generation browsers that enable a web page to be more.
Additional Topics. Tutorial #9 Review – Forms Forms Legend and fieldset Fields Text Password Radio buttons, check box, text area, select lists Buttons.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
Copyright© 2002 Avaya Inc. All rights reserved Advanced Cross Site Scripting Evil XSS Anton Rager.
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
Origins, Cookies and Security – Oh My! John Kemp, Nokia Mobile Solutions.
Dynamic Web Pages (Flash, JavaScript)
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
1-Vulnerabilities 2-Hackers 3-Categories of attacks 4-What a malicious hacker do? 5-Security mechanisms 6-HTTP Web Servers 7-Web applications attacks.
IST 210 Web Application Security. IST 210 Introduction Security is a process of authenticating users and controlling what a user can see or do.
Copyright 2007 © 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.
CSE 190: Internet E-Commerce Lecture 5. Exam Material Lectures 1-4 (Presentation Tier) –3-tier architecture –HTML –Style sheets –Javascript –DOM –HTTP.
Top Five Web Application Vulnerabilities Vebjørn Moen Selmersenteret/NoWires.org Norsk Kryptoseminar Trondheim
10/20/2015 ©2006 Scott Miller, University of Victoria 1 User Authentication Content Generation The Use of Cookies Content Pooling Rev 1.5.
Building Rich Web Applications with Ajax Linda Dailey Paulson IEEE – Computer, October 05 (Vol.38, No.10) Presented by Jingming Zhang.
Session: 1. © Aptech Ltd. 2Introduction to the Web / Session 1  Explain the evolution of HTML  Explain the page structure used by HTML  List the drawbacks.
Web Applications Testing By Jamie Rougvie Supported by.
Building Secure Web Applications With ASP.Net MVC.
Real-World AJAX Seminar - March 13, 2006 Bringing the Richness and Responsiveness of Desktop Applications to the Web Sahil Malik telerik.
HTML Forms. Slide 2 Forms (Introduction) The purpose of input forms Organizing forms with a and Using different element types to get user input A brief.
University of Central Florida The Postman Always Rings Twice: Attacking & Defending postMessage in HTML5 Websites Ankur Verma University of Central Florida,
Introduction to HTML. _______________________________________________________________________________________________________________ 2 Outline Key issues.
WEB SERVER SOFTWARE FEATURE SETS
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Internet Explorer 10 IE9 hardware-accelerated platform CSS 2D Transforms CSS Backgrounds & Borders CSS Color CSS Fonts CSS Media Queries CSS Namespaces.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
Play, Hack and Track Amit Ashbel Product Evangelist
ASP.NET 2.0 Security Alex Mackman CM Group Ltd
Customizing Share Document Previews Will Abson Senior Integrations Engineer and Share Extras Project Lead
By Collin Donaldson. Hacking is only legal under the following circumstances: 1.You hack (penetration test) a device/network you own. 2.You gain explicit,
Checkmarx choose what developers use. About us o Founded in 2006 o Enterprise Grade Static and Interactive Application Security Testing Solutions o Hundreds.
THE FUTURE IS HERE: APPLICATION- AWARE CACHING BY ASHOK ANAND.
Open Solutions for a Changing World™ Eddy Kleinjan Copyright 2005, Data Access WordwideNew Techniques for Building Web Applications June 6-9, 2005 Key.
ArcGIS for Server Security: Advanced
DHTML.
Group 18: Chris Hood Brett Poche
Cross-Site Scripting Travis Deyarmin.
Application with Cross-Platform GUI
AJAX.
Dynamic Web Pages (Flash, JavaScript)
Building responsive apps and sites with HTML5 web workers
Architecture of the web
Protecting Against Common Web Application Vulnerabilities
HTML5 - 2 Forms, Frames, Graphics.
Advanced Cross Site Scripting Evil XSS
Web Application Development Using PHP
Presentation transcript:

Warning Ahead: Security Storms are Brewing in Your JavaScript Yuval Idan, Technical Director, APAC Checkmarx

About us o Founded in 2006 o Enterprise Grade Application Security Solutions: SAST | RASP | Application Security Education o Hundreds of Fortune 500 and SMB Customers o Fanatical support “Leader” in the 2014 AST Wave “Challenger “ AST Magic Quadrant & Only Vendor to score a perfect 5 in 2014 AST Critical Capabilities Report Fastest Growing Security Company in Israel, 2014 Tech Fast 500 Red Herring EMEA Top 100 Winners Awards

Warning Ahead: Security Storms are Brewing in Your JavaScript

About Me Yuval Idan Technical Director, APAC Checkmarx

Agenda o Broken sandbox o Same old XSS becomes a monster o Watch out for your client side o “I know where you were last summer”

HTML5 is booming Report released in August 2013 has shown that 153 of the Fortune 500 U.S. companies already implemented HTML5 on their corporate websites.Fortune 500

Some of the additions in HTML5 o WEB storage o WEB SQL database o Indexed DB o Application cache o Web workers o Web socket o CORS o Web messaging o Sandbox attribute o New HTTP headers o Server sent events o New and better semantic tags o New form types o Audio and video tags o Canvas o Inline SVG o New onevent attributes o Geolocation o New CSS selectors o New javascipt selectors o Custom data - attributes

The Sandbox Attribute

SOP Same Origin Policy permits scripts running on pages originating from the same site based on combination of schemescheme, hostname, and port numberhostnameport number

Same Origin Policy main page “Change background to green” Iframe same origin

Same Origin Policy main page “Change background to green” Iframe different origin

Markets o Recent trend - markets of extensions Salesforce.com, Microsoft 365, etc… o Extension is Javascript code written by a 3 rd party but hosted and delivered from the very same server o So SOP doesn’t play well

Sandbox concept Sandbox concept? Sandbox is a hardening of the basic SOP – so that any content running in the sandboxed iframe is treated as if it comes from a different origin, and it gives fine-grained control over what restrictions apply.

Sandbox syntax o Syntax o Attribute Values ValueDescription ""Applies all restrictions below allow-same-originAllows the iframe content to be treated as being from the same origin as the containing document allow-top-navigationAllows the iframe content to navigate (load) content from the containing document allow-formsAllows form submission allow-scriptsAllows script execution

main page alert(1) 1 Iframe / same origin

main page alert(1) Sandboxed Iframe Default permissions Same Origin

main page alert(1) 1 Sandboxed Iframe Allowing Scripts and SOP(Same Origin)

main page top.navigate(…) Sandboxed Iframe Allowing Scripts and SOP(Same Origin)

main page top.find(myself) addPermission(myself, top_nav) Refresh() navigate(…) Sandboxed Iframe Allowing Scripts and SOP(Same Origin) And Top Navigation

main page top.find(myself) addPermission(myself, top_nav) Refresh() Navigate( Sandboxed Iframe Allowing Scripts and SOP(Same Origin) And Top Navigation

Don’t just count on Sandbox! Don’t assume that just because an iFrame is sandboxed, your code is secure. What can you do? Avoid granting a sandboxed iFrame with scripting and SOP capabilities.

How a single XSSed page can be used to take screenshots of other non-XSSed page ?

Canvas Demo Is the HTML5 element, used to draw graphics, on the fly, via scripting (usually JavaScript).

Monster XSS – Attack Steps o Step A – Use Bookstore project Login page vulnerable to Reflected XSS to embed itself in an iframe Iframe border (left visible for demo purposes)

Monster XSS – Attack steps o Step B – The user logs in and browses the inside frame. The outer page remains the same while it’s scripts can access the inner’s data Iframe border (left visible for demo purposes) The user went to the admin page, but the URL is still the XSS’ed login page

Monster XSS – The result o The attacker gets set of pictures representing all user activity( yes, including user name and password!)

Monster XSS – The technique o HTML5 introduced the concept of Canvas, which can be used to take screenshots What is Canvas? (w3schools) The HTML5 element is used to draw graphics, on the fly, via scripting (usually JavaScript).

Monster XSS – The technique o Html2canvas - open-source script which builds screenshots based on DOM information. o We modify it a bit – to reveal passwords

Monster XSS – The technique Modified HTML2Canvas runs at the outer page and every 2 seconds takes screenshots of the iframe XSS that takes base64 screenshots

Monster XSS – The technique

New Tricks, Old Dog- hidden slide o Live Just an XSS o alert('hi') alert('hi') Sticky o src=" width="100%" height="100%“> Now, we can use a component called HTML2Canvas to take screenshots o This gives the following: o src=' But we can further manipulate the component to even…. (Login page)

Monster XSS – bottom line So, what can you do ? Get rid of XSS!!!

WebSockets

Web Socket WebSocket – allows persistent connection between the client and the server, when both parties can start sending data at any time.

Super-charged XSS

New Tricks, Old Dog o XSS can be used as an agent to map the structure of a network behind a firewall o Super-charged XSS Advanced port scanning (WebSockets) o

o Websocket Fast and efficient network mapping process Firewall bypass into organization

Client-Side Business Logic

Pacman - winning the odds o Client site business logic helps to gain efficiency. o Efficiency brings along security costs

Pacman Demo

Pacman – recommendations o Don’t trust the client: validate user input o Do not ever store business logic on the client

GeoLocation

A Variant of Clickjacking How to trick victims into turning on their PC cameras without them even realizing?

A Variant of Clickjaking Demo

A Variant of Clickjaking Against attacks focused on social engineering There is only one solution Awareness

Summary o HTML5 brings enhancements to Web development o …which comes with some great enhancements to security vulnerabilities

Demo

Thank You! Yuval Idan |