© 2011 IBM Corporation Hybrid Analysis for JavaScript Security Assessment Omer Tripp Omri Weisman Salvatore Guarnieri IBM Software Group Sep 2011.

Slides:



Advertisements
Similar presentations
Past, Present and Future By Eoin Keary and Jim Manico
Advertisements

© 2009 IBM Corporation IBM Rational Application Security The Bank Job Utilizing XSS Vulnerabilities Adi Sharabani IBM Rational Application Security Research.
Closing the Gap: Analyzing the Limitations of Web Application Vulnerability Scanners David Shelly Randy Marchany Joseph Tront Virginia Polytechnic Institute.
Type-based Taint Analysis for Java Web Applications Wei Huang, Yao Dong and Ana Milanova Rensselaer Polytechnic Institute 1.
GATEKEEPER MOSTLY STATIC ENFORCEMENT OF SECURITY AND RELIABILITY PROPERTIES FOR JAVASCRIPT CODE Salvatore Guarnieri & Benjamin Livshits Presented by Michael.
1 Yinzhi Cao, Zhichun Li *, Vaibhav Rastogi, Yan Chen, and Xitao Wen Labs of Internet Security and Technology Northwestern University * NEC Labs America.
Abhinn Kothari, 2009CS10172 Parth Jaiswal 2009CS10205 Group: 3 Supervisor : Huzur Saran.
1 FLAX: Systematic Discovery of Client-Side Validation Vulnerabilities in Rich Web Applications Pongsin Poosankam ‡* Prateek Saxena * Steve Hanna * Dawn.
By Philipp Vogt, Florian Nentwich, Nenad Jovanovic, Engin Kirda, Christopher Kruegel, and Giovanni Vigna Network and Distributed System Security(NDSS ‘07)
SOFTWARE SECURITY JORINA VAN MALSEN 1 FLAX: Systematic Discovery of Client-Side Validation Vulnerabilities in Rich Web Applications.
Server-Side vs. Client-Side Scripting Languages
Web Audit Vulnerability cross-site scripting (XSS) concerns by Ron Widitz.
Leveraging User Interactions for In-Depth Testing of Web Applications Sean McAllister, Engin Kirda, and Christopher Kruegel RAID ’08 1 Seoyeon Kang November.
Computer Security and Penetration Testing
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
Automated Web Patrol with Strider HoneyMonkeys Present by Zhichun Li.
Introduction to the OWASP Top 10. Cross Site Scripting (XSS)  Comes in several flavors:  Stored  Reflective  DOM-Based.
CROSS SITE SCRIPTING..! (XSS). Overview What is XSS? Types of XSS Real world Example Impact of XSS How to protect against XSS?
Leveraging User Interactions for In-Depth Testing of Web Application Sean McAllister Secure System Lab, Technical University Vienna, Austria Engin Kirda.
Handling Security Threats in Kentico CMS Karol Jarkovsky Sr. Solution Architect Kentico Software
Web Programming Language Dr. Ken Cosh Week 1 (Introduction)
Automatic Creation of SQL Injection and Cross-Site Scripting Attacks 2nd-order XSS attacks 1st-order XSS attacks SQLI attacks Adam Kiezun, Philip J. Guo,
Phu H. Phung Chalmers University of Technology JSTools’ 12 June 13, 2012, Beijing, China Joint work with Lieven Desmet (KU Leuven)
Glass Box Testing: Thinking Inside the Box Omri Weisman Manager, Security Research Group IBM Rational.
Presentation by Kathleen Stoeckle All Your iFRAMEs Point to Us 17th USENIX Security Symposium (Security'08), San Jose, CA, 2008 Google Technical Report.
INTRODUCTION TO WEB DATABASE PROGRAMMING
Is Your Website Hackable? Check with Acunetix Web Vulnerability Scanner. Acunetix Web Vulnerability Scanner V9.
4.1 JavaScript Introduction
HTML5 Group 3: Dongyang Zhang, Wei Liu, Weizhou He, Yutong Wei, Yuxin Zhu.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Copyright© 2002 Avaya Inc. All rights reserved Advanced Cross Site Scripting Evil XSS Anton Rager.
Cross-Site Scripting Vulnerabilities Adam Doupé 11/24/2014.
+ Websites Vulnerabilities. + Content Expand of The Internet Use of the Internet Examples Importance of the Internet How to find Security Vulnerabilities.
NDSS 2007 Philipp Vogt, Florian Nentwich, Nenad Jovanovic, Engin Kirda, Christopher Kruegel, Giovanni Vigna.
BLUEPRINT: Robust Prevention of Cross-site Scripting Attacks for Existing Browsers Mike Ter Louw, V.N. Venkatakrishnan University of Illinois at Chicago.
Penetration Testing James Walden Northern Kentucky University.
CNIT 133 Interactive Web Pags – JavaScript and AJAX JavaScript Environment.
Saving the World Wide Web from Vulnerable JavaScript International Symposium on Software Testing and Analysis (ISSTA 2011) Omer Tripp IBM Software Group.
Master Thesis Defense Jan Fiedler 04/17/98
nd Joint Workshop between Security Research Labs in JAPAN and KOREA Profile-based Web Application Security System Kyungtae Kim High Performance.
CSC-682 Cryptography & Computer Security Sound and Precise Analysis of Web Applications for Injection Vulnerabilities Pompi Rotaru Based on an article.
Top Five Web Application Vulnerabilities Vebjørn Moen Selmersenteret/NoWires.org Norsk Kryptoseminar Trondheim
Slide 12.1 Chapter 12 Implementation. Slide 12.2 Learning outcomes Produce a plan to minimize the risks involved with the launch phase of an e-business.
Lecture 9: AJAX, Javascript review..  AJAX  Synchronous vs. asynchronous browsing.  Refreshing only “part of a page” from a URL.  Frameworks: Prototype,
Cross Site Scripting and its Issues By Odion Oisamoje.
ASP. What is ASP? ASP stands for Active Server Pages ASP is a Microsoft Technology ASP is a program that runs inside IIS IIS stands for Internet Information.
Vaibhav Rastogi and Yi Yang.  SOP is outdated  Netscape introduced this policy when most content on the Internet was static  Differences amongst different.
Presented By: Chandra Kollipara. Cross-Site Scripting: Cross-Site Scripting attacks are a type of injection problem, in which malicious scripts are injected.
Web Security Lesson Summary ●Overview of Web and security vulnerabilities ●Cross Site Scripting ●Cross Site Request Forgery ●SQL Injection.
Spectator: Detection and Containment of JavaScriptWorms
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
TEMPLATE DESIGN © Crawling is the process of automatically exploring a web application to discover the states of the application.
JavaScript and Ajax (JavaScript Environment) Week 6 Web site:
Strings Robin Burke IT 130. Outline Objects Strings methods properties Basic methods Form validation.
Software Security. Bugs Most software has bugs Some bugs cause security vulnerabilities Incorrect processing of security related data Incorrect processing.
Security Tool to Detect Vulnerabilities at Application Level Krishna Sai Mulpuri Naga Sri Charan Pendyala Rama Krishna Chaitanya Somavajhala Srujana Bollina.
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,
JavaScript Invented 1995 Steve, Tony & Sharon. A Scripting Language (A scripting language is a lightweight programming language that supports the writing.
SlideSet #20: Input Validation and Cross-site Scripting Attacks (XSS) SY306 Web and Databases for Cyber Operations.
Constraint Framework, page 1 Collaborative learning for security and repair in application communities MIT site visit April 10, 2007 Constraints approach.
Web Security (cont.) 1. Referral issues r HTTP referer (originally referrer) – HTTP header that designates calling resource  Page on which a link is.
Web Programming Language
XSS (Client-side) CSCE 548 Building Secure Software(07/20/2016)
CSCE 548 Student Presentation Ryan Labrador
Presentation by: Naga Sri Charan Pendyala
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
All You Ever Wanted to Know About Dynamic Taint Analysis & Forward Symbolic Execution (but might have been afraid to ask) Edward J. Schwartz, Thanassis.
Advanced Cross Site Scripting Evil XSS
Exploring DOM-Based Cross Site Attacks
Presentation transcript:

© 2011 IBM Corporation Hybrid Analysis for JavaScript Security Assessment Omer Tripp Omri Weisman Salvatore Guarnieri IBM Software Group Sep 2011

© 2011 IBM Corporation Hybrid Analysis for JavaScript Security Assessment 2 Why JavaScript Analysis? According to an IBM study performed in 2010

© 2011 IBM Corporation Hybrid Analysis for JavaScript Security Assessment 3 Why JavaScript Analysis? (cont.) 15 % According to an IBM study performed in 2010 of Fortune 500 websites have exploitable security issues in JavaScript. DOM-based XSS document.write(document.URL.substring( pos,document.URL.length)); DOM-based XSS document.write(document.URL.substring( pos,document.URL.length)); Open Redirect var pos = document.location.href.indexOf("name="); var val = document.location.href.substring(pos); document.location.href = " + val; Open Redirect var pos = document.location.href.indexOf("name="); var val = document.location.href.substring(pos); document.location.href = " + val;

Reflective property access Prototype chain property lookup Lexical scoping Function pointers Arguments array eval and its relatives Complexities of JavaScript var a = "foo" + "bar"; var b = obj[a]; function F() { this.bar = document.url; } function G() { } G.prototype = new F(); var a = new G(); write(g.bar); function foo() { var y = 42; var bar = function() { write(y); } var m = function()... var k = function(f) { f(); } k(m); function sum() { if (arguments.length > 3) { eval(arguments[1]); } sum(1, "...”, 3) eval("document.write('evil')"); 4

Analysis Example function foo(p1, p2) { p1.f = p2.f; } var a = new Object(); var b = new Object(); b.f = window.location.toString(); var c = new Object(); var d = new Object(); d.f = "safe"; foo(a, b); foo(c, d); document.write(a.f); // This is a taint violation document.write(c.f); // This is NOT a taint violation Since d.f is not tainted, c.f will not be tainted Install taint summary for foo: p2.f -> p1.f 5 Taint variable: (v2, foo, )

© 2011 IBM Corporation Hybrid Analysis for JavaScript Security Assessment 6 Hybrid analysis Why Hybrid Analysis? Static analysis + Performance + Soundness + Coverage - Frameworks - Dynamic loading Dynamic analysis + Dynamic behavior - Coverage + Performance + Soundness + Coverage + Dynamic Behavior

© 2011 IBM Corporation Hybrid Analysis for JavaScript Security Assessment 7 Static Analysis  Typically applied to server-side JavaScript content  Misses dynamically generated JavaScript! document.write('<scr'+'ipt '); document.write('src=" ThisLink.cgi?g'+ _This_Link+'"'); document.write(' type="text/javascript">'); document.write(' ');

© 2011 IBM Corporation Hybrid Analysis for JavaScript Security Assessment 8 Traditional Black-box Testing  Sends test payload in HTTP request  Checks response for reflected payload  Does not work for DOM-based XSS! AttackerVictim Web Application link embedded with evil script Attacker’s evil script executed using victim’s credentials Evil script not sent to server

© 2011 IBM Corporation Hybrid Analysis for JavaScript Security Assessment 9 Sandboxed JavaScript Execution alert('hacked') Black-box Scanner

© 2011 IBM Corporation Hybrid Analysis for JavaScript Security Assessment 10 Dynamic Taint Analysis Source Sink document.URL document.write() execution flow

© 2011 IBM Corporation Hybrid Analysis for JavaScript Security Assessment 11 Our Hybrid Architecture Black-box Scanner DOM modeling Taint analysis String analysis Reduce scope Find issues Eliminate false positives HTML/JavaScript, concrete URLs, … issues

© 2011 IBM Corporation Hybrid Analysis for JavaScript Security Assessment 12  Specialized string analysis using dynamic pieces of information (e.g., concrete URL)  Part controlled by attacker is unknown, but known prefix modeled precisely var str = document.URL; var url_check = str.indexOf('login.html'); if (url_check > -1) { result = str.substring(0,url_check); result = result + 'login.jsp' + str.substring((url_check+search_term.length), str.length); document.URL = result; } Hybrid Elimination of False Reports CONTROLLED BY ATTACKERNOT CONTROLLED BY ATTACKER URL as Source "

© 2011 IBM Corporation Hybrid Analysis for JavaScript Security Assessment 13 String Analysis: Example String variable Integer variable

© 2011 IBM Corporation Hybrid Analysis for JavaScript Security Assessment 14 Hybrid DOM Modeling  The HTML DOM is an important channel of data propagation, but often too big (>10 5 lines of text) for the analysis to model!  In the hybrid setting –the analysis operates on a fully resolved DOM –the analysis can thus “reduce” the DOM BEFORE DOM reduction AFTER

© 2011 IBM Corporation Hybrid Analysis for JavaScript Security Assessment 15 Implementation & Evaluation  Algorithm featured in IBM Rational AppScan Standard Edition, a black-box security-scanning product  Experimental hypotheses: –(1 st experiment) The DOM-modeling and string-analysis specialization features have significant impact on the quality of the static security scanner –(2 nd experiment) The hybrid solution is significantly better than the baseline security scanner, which performs sandboxed JavaScript execution

© 2011 IBM Corporation Hybrid Analysis for JavaScript Security Assessment 16 1 st Experiment: Results  pages from each site  4 configurations: with/without DOM modeling, string analysis  Results: –Without DOM modeling: too many crashes! –String analysis highly effective Total number of JavaScript security vulnerabilities detected for 675 websites

© 2011 IBM Corporation Hybrid Analysis for JavaScript Security Assessment 17 2 nd Experiment: Results Number of websites tested60 Websites found to be vulnerable by baseline scanner (w/o hybrid capabilities) 8 (0 false positives) Websites found to be vulnerable by scanner with hybrid capabilities 33 (4 false positives)  Sites selected at random (out of 675 sites used for 1 st experiment)  False reports due to infeasible/rare path conditions Client-side vulnerabilities found by black-box scanner with and without hybrid capabilities

© 2011 IBM Corporation Hybrid Analysis for JavaScript Security Assessment 18 Summary  Hybrid JavaScript security analysis is a powerful approach –Allows new and exciting specialization techniques –Transcends inherent weaknesses of static and dynamic analyses  Thousands of real vulnerabilities discovered using our tool when applied to highly popular sites (Fortune 500, top 100 sites list, etc.) –Very low rate of false reports (thanks to string analysis) –Scales to real-world JavaScript and HTML (thanks to DOM modeling)

© 2011 IBM Corporation Hybrid Analysis for JavaScript Security Assessment Thank you 19