NoTamper: Automatic Blackbox Detection of Parameter Tampering Opportunities In Web Applications Prithvi Bisht (http://cs.uic.edu/~pbisht)+ Timothy Hinrichs*,

Slides:



Advertisements
Similar presentations
Bypassing Client-Side Protection CSE 591 – Security and Vulnerability Analysis Spring 2015 Adam Doupé Arizona State University
Advertisements

Parameter Tampering. Attacking the Ecommerce Shopping Cart In the above image we see that a user who wants to purchase a Television visits an online Store.
OWASP WEBGOAT Alaa Darabseh Department of Computer Science
AUTOMATED DISCOVERY OF PARAMETER POLLUTION VULNERABILITIES IN WEB APPLICATIONS Marco Balduzzi, Carmen Torrano Gimenez, Davide Balzarotti, and Engin Kirda,
JavaScript Forms Form Validation Cookies. What JavaScript can do  Control document appearance and content  Control the browser  Interact with user.
Automating Bespoke Attack Ruei-Jiun Chapter 13. Outline Uses of bespoke automation ◦ Enumerating identifiers ◦ Harvesting data ◦ Web application fuzzing.
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
By Brian Vees.  SQL Injection  Username Enumeration  Cross Site Scripting (XSS)  Remote Code Execution  String Formatting Vulnerabilities.
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
JavaScript Forms Form Validation Cookies CGI Programs.
Input Validation For Free Text Fields Project Members: Hagar Offer &Ran Mor Academic Advisor: Dr Gera Weiss Technical Advisors: Raffi Lipkin & Nadav Attias.
XP Tutorial 9 New Perspectives on JavaScript, Comprehensive1 Working with Cookies Managing Data in a Web Site Using JavaScript Cookies.
Leveraging User Interactions for In-Depth Testing of Web Applications Sean McAllister, Engin Kirda, and Christopher Kruegel RAID ’08 1 Seoyeon Kang November.
Security Issues in Web Applications Vitaly Shmatikov CS 6431.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
CST JavaScript Validating Form Data with JavaScript.
4-Sep-15 HTML Forms Mrs. Goins Web Design Class. Parts of a Web Form A Form is an area that can contain Form Control/Elements. Each piece of information.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
WAPTEC: Whitebox Analysis of Web Applications for Parameter Tampering Exploit Construction Prithvi Bisht ( + Timothy Hinrichs*
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
CHAPTER 12 COOKIES AND SESSIONS. INTRO HTTP is a stateless technology Each page rendered by a browser is unrelated to other pages – even if they are from.
Chapter 3 Using Validation Controls. What is a Validation Control? A control that validates the value in another control Renders as an HTML tag with an.
Security.NET Chapter 1. How Do Attacks Occur? Stages of attack Examples of attacker actions 1. FootprintRuns a port scan on the firewall 2. PenetrationExploits.
Prevent Cross-Site Scripting (XSS) attack
Lets Make our Web Applications Secure. Dipankar Sinha Project Manager Infrastructure and Hosting.
1 CS 3870/CS 5870 Static and Dynamic Web Pages ASP.NET and IIS.
Chapter 5 Java Script And Forms JavaScript, Third Edition.
Chapter 6: Forms JavaScript - Introductory. Previewing the Product Registration Form.
Validation Controls. Validation Server Controls These are a special type of Web server control. They significantly reduce some of the work involved in.
CSCI 6962: Server-side Design and Programming Introduction to AJAX.
Prithvi Bisht, Timothy Hinrichs, Nazari Skrupsky, Radoslaw Bobrowicz, V.N. Venkatakrishnan University of Illinois at Chicago, USA ACM CCS (Oct,2010) Prithvi.
+ Websites Vulnerabilities. + Content Expand of The Internet Use of the Internet Examples Importance of the Internet How to find Security Vulnerabilities.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
CSCI 6962: Server-side Design and Programming Secure Web Programming.
Lecture 14 – Web Security SFDV3011 – Advanced Web Development 1.
BLUEPRINT: Robust Prevention of Cross-site Scripting Attacks for Existing Browsers Mike Ter Louw, V.N. Venkatakrishnan University of Illinois at Chicago.
Working with Cookies Managing Data in a Web Site Using JavaScript Cookies* *Check and comply with the current legislation regarding handling cookies.
Lecture 16 Page 1 CS 236 Online SQL Injection Attacks Many web servers have backing databases –Much of their information stored in a database Web pages.
CS453: State in Web Applications (Part 1) State in General Sessions (esp. in PHP) Prof. Tom Horton.
XSS-GUARD : Precise Dynamic Prevention of Cross Site Scripting (XSS) Attacks Prithvi Bisht ( Joint work with : V.N. Venkatakrishnan.
COMP3121 E-Commerce Technologies Richard Henson University of Worcester November 2011.
Chapter 8 Cookies And Security JavaScript, Third Edition.
Using Client-Side Scripts to Enhance Web Applications 1.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
Top Five Web Application Vulnerabilities Vebjørn Moen Selmersenteret/NoWires.org Norsk Kryptoseminar Trondheim
NMD202 Web Scripting Week3. What we will cover today Includes Exercises PHP Forms Exercises Server side validation Exercises.
CANDID : Preventing SQL Injection Attacks Using Dynamic Candidate Evaluations V. N. Venkatakrishnan Assistant Professor, Computer Science University of.
Web Logic Vulnerability By Eric Jizba and Yan Chen With slides from Fangqi Sun and Giancarlo Pellegrino.
STATE MANAGEMENT.  Web Applications are based on stateless HTTP protocol which does not retain any information about user requests  The concept of state.
Security Attacks CS 795. Buffer Overflow Problem Buffer overflows can be triggered by inputs that are designed to execute code, or alter the way the program.
By Sean Rose and Erik Hazzard.  SQL Injection is a technique that exploits security weaknesses of the database layer of an application in order to gain.
Spectator: Detection and Containment of JavaScriptWorms
Security Attacks CS 795. Buffer Overflow Problem Buffer overflow Analysis of Buffer Overflow Attacks.
INT222 - Internet Fundamentals Shi, Yue (Sunny) Office: T2095 SENECA COLLEGE.
ICM – API Server & Forms Gary Ratcliffe.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
© 2011 IBM Corporation Hybrid Analysis for JavaScript Security Assessment Omer Tripp Omri Weisman Salvatore Guarnieri IBM Software Group Sep 2011.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Module: Software Engineering of Web Applications Chapter 3 (Cont.): user-input-validation testing of web applications 1.
What Is XSS ? ! Cross-site scripting (XSS) is a type of computer security vulnerability typically found in Web applications. XSS enables attackers to.
Session 11: Cookies, Sessions ans Security iNET Academy Open Source Web Development.
INTERNET APPLICATIONS CPIT405 Forms, Internal links, meta tags, search engine friendly websites.
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.
Module: Software Engineering of Web Applications
SQL Injection Attacks Many web servers have backing databases
MIS Professor Sandvig MIS 324 Professor Sandvig
What is Cookie? Cookie is small information stored in text file on user’s hard drive by web server. This information is later used by web browser to retrieve.
Lecture 2 - SQL Injection
Presentation transcript:

NoTamper: Automatic Blackbox Detection of Parameter Tampering Opportunities In Web Applications Prithvi Bisht ( Timothy Hinrichs*, Nazari Skrupsky+, Radoslaw Bobrowicz+, V.N. Venkatakrishnan+ +: University of Illinois, Chicago * : University of Chicago, Chicago

Background: User Input Validation Web applications need to Validate user supplied input Reject invalid input E xamples: “Credit card number is exactly16 digits” “Expiration date of Jan 2009 is not valid” Validation traditionally done at server: round-trip, load Popular trend: Client-side validation through JavaScript

Client Side Validation using JavaScript onSubmit= validateCard(); validateQuantities(); Validation Pass? send inputs to server reject inputs YesNo

Problem: Client is Untrusted Environment Validation can be bypassed Previously rejected values, sent to server Invalid quantity: -4 Ideally: Re-validate at server-side and reject If not, security risks

Example: Bypassed Validation Security Risks Client validation:  Field: quantity “reject negative values” Server-side code: cost = cost + price * quantity How to automatically find such inputs in a blackbox fashion?  quantity = 1, price = 100 cost = cost  quantity= -1, price = 100 cost = cost - 100

Intuition Automatically generate two sets of inputs  Valid inputsquantity = 1  Invalid inputs quantity = -1  Done through client code analysis If ( quantity ≥ 0 ) submit to application else reject, ask to re-enter How does the server-side code respond  Heuristically determine if server rejects invalid inputs  Server rejects: quantity = -1 quantity = 1 (valid input) quantity= -1 (invalid input)

NoTamper Architecture and Outline Formula Extractor Web Page Input Generator Opportunity Detector External analysis Logical formula for client side validation F client : quantity ≥ 0 Solve constraints Benign inputs e.g., quantity = 0 Hostile inputs e.g., quantity = -1 Compare responses for benign and hostile inputs opportunities exploits hints Outline 1.Formula extraction from client code 2.Input generation 3.Opportunity detection 4.Evaluation 5.Conclusion

Formula Extraction from Client Code HTML and JavaScript both restrict inputs HTML form controls  Drop down menu: valueIN (value_1, …, value_n)  Radio/Checkboxes:valueIN(value_1,…, value_n)  Hidden attribute:value=constant  Readonly attribute:value=constant  Maxlength attribute:length(value)≤constant Drop down menu: select one of these card == 1234… OR card == 7890… tags attributes Constraint

Formula Extraction from Client Code (cont…) Event driven JavaScript validation State machine  Start: no fields validated, end: all validation passed  Transitions w/ validation functions: f 1, f 2, … f n  Over-approximation: All function executed: f 1 f 2 …f n Execute functions symbolically  conditions when all functions accept inputs Valid: none Invalid: all Valid: all Invalid: none (form submitted) Valid: field1 Invalid: rest fkfk f1f1 f2f2 fnfn fmfm onChange onSubmit

Formula Extraction from Client Code (cont…) Program condition when validation succeeds if (quantity ≥ 0) return true; constraint: quantity ≥ 0 else return false; JavaScript interaction w/ Document Object Model  Reading form fields (e.g., getElementById )  Enable/disable form fields (e.g., disabled property) At the end of symbolic execution F client = (path conditions) AND (constraints of enabled fields)

1.Formula extraction from client code 2.Input generation 3.Opportunity detection 4.Evaluation 5.Conclusion Outline

Input Generation Benign inputs  Pass client side validation  Satisfy F client Example: F client : quantity ≥ 0 Satisfying values determined with type information  Collected while analyzing HTML/JavaScript  quantity: -? [0-9]* quantity = 1 Constraint solving

Input Generation (cont…) Hostile inputs  Bypass client side validation  Satisfy NOT (F client ) Example: NOT ( quantity ≥ 0 ) Supplying required variables  Example:  Field value mandated by JavaScript  Heuristics: special markers like * in the field description quantity = -1 gift-note = “abc” gift-note = “-” NOT (quantity ≥ 0) U NOT (gift-note in [a-z]*)

1.Formula extraction from client code 2.Input generation 3.Opportunity detection 4.Evaluation 5.Conclusion Outline

Opportunity Detection Rejected inputs Accepted inputs Different structures Response for hostile inputs Response for Benign inputs Response for hostile inputs Exploit opportunity Similar structures

Opportunity Detection (contd…) Compare responses to benign and hostile inputs  But noise: user name, address, time, online users, … a1 a2 a3 a1 a2 a3 b1 a2 a3 h1 a2 a3 B1 B2 --- a2 a3 Remove differences H1 B1 --- a2 a3 C1 C2 Difference rank = Edit Distance (C1,C2) Low rank  opportunity

1.Formula extraction from client code 2.Input generation 3.Opportunity detection 4.Evaluation 5.Conclusion Outline

Applications ApplicationLOCConstraints sourceUse SMF97KHTML+JavaScriptForum Ezybiz186KHTML+JavaScriptBusn Mgt OpenDB92KHTML+JavaScriptInventory MyBloggie9KHTML+JavaScriptBlog B2evolution167KHTMLBlog PhpNuke228KHTML+JavaScriptContent Mgt OpenIT114KHTML+JavaScriptSupport LegalCase58KHTMLInventory smi-online.co.uk---HTMLConference wiley.com---HTML+JavaScriptLibrary garena.com---HTMLGaming selfreliance.com---HTMLBanking codemicro.com---HTML+JavaScriptShopping 8 open source 5 live sites

Applications (cont…) Hostile and benign responses separated by an order of magnitude ApplicationFor ms Hostile Inputs Opport unities Confi rmed SMF556 Ezybiz337 OpenDB110 MyBloggie18 B2evolution125 PhpNuke16 OpenIT328 LegalCase213 smi-online.co.uk123 wiley.com115 garena.com14 selfreliance.com15 codemicro.com16 ApplicationFor ms Hostile Inputs Opport unities Confi rmed SMF55642√ Ezybiz33735√ OpenDB1108√ MyBloggie188√ B2evolution12521 PhpNuke165√ OpenIT32827√ LegalCase2139√ smi-online.co.uk1234 wiley.com1154 garena.com144 selfreliance.com151√ codemicro.com161√ Confirmed exploits: 9/13 applications Opportunities: 169 Examined: 50

SelfReliance.com: Online banking Vulnerability: from/to – arbitrary accounts Exploit: Unauthorized money transfers  Transfer money from unrelated accounts  Account number hardly a secret e.g., checks contain them Status: fixed within 24 hours  ESP solution (espsolution.net) s/w provider patched s/w for other clients Client-side constraints: 1.from IN (Accnt1, Accnt2) 2.to IN (Accnt1, Accnt2) Server-side code: transfer money from  to

CodeMicro.com : Shopping Vulnerability: quantities can be negative Exploit: Unlimited shopping rebates  Two items in cart: price1 = 100$, price2 = 500$  quantity1 = -4, quantity2 = 1, total = 100$ (rebate of 400$ on price2) Status: fixed within 24 hours Client-side constraints: 1.quantity1 ≥ 0 2.quantity2 ≥ 0 Server-side code: total = quantity1 * price1 + quantity2 * price2

OpenIT: Support Vulnerability: update arbitrary account Exploit: Privilege escalation  Inject a Cross-site scripting (XSS) payload in admin account  Cookies stolen every time admin logged in. Status: open Client-side constraints: 1.userId == 1(hidden field) Server-side code: Update profile with id 1, with new details Hidden Field

1.Formula extraction from client code 2.Input generation 3.Opportunity detection 4.Evaluation 5.Conclusion Outline

Conclusion Framework to identify parameter tampering opportunities  Used client-side restrictions to aid hostile input generation  Several serious problems in open source / commercial applications  Significant gap: validation that should happen and that does happen Thanks and Questions

Backup

False positives maxlength constraints: 31 Mutated inputs: 12

Split of HTML, JavaScript and Hidden Field Constraints HTMLconstraints: 110/169(65%) JavaScript constraints: 20/169(12%) Hidden fields constraints: 39/169(23%)

Manual intervention Unique variables: 3 (SMF: 2, phpNuke: 1) Session id/cookies: all except phpNuke Required variables: 12 (SMF: 5, phpNuke: 4, B2Evolution: 1, Garena.com: 2) Typically 5 minutes per form Bounded by the number of fields

Limitations Unsound  False positive: application mutates invalid inputs e.g., truncate 12 such instances in our experiments  False positive: similar responses for failure/success Incomplete  JavaScript over-approximation Mutually exclusive events may cause Fclient – false  JavaScript unhandled features document.write/eval  constraints not checked at client Fclient = true

Some related work Input validation  Prevent affect of invalid inputs: Su et al. POPL’06, Bandhakavi et al. CCS’07, Saxena et al.NDSS’09, Van Gundy M et al. Oakland’09, Ter-louw et al. Oakland’09  Find insufficient validation: Livshits et al. Usenix’05, Balzarotti et al. CCS’07, Balzarotti et al. Oakland’08, … Vulnerability analysis  JavaScript analysis based client side attacks: Saxena et al. Oakland’10 Fuzzing/directed testing  Benign/Hostile input generation: Godefroid et al. SIGPLAN’05, Godefroid et al. NDSS’08, Saxena et al. NDSS’10, … Prevention techniques  Sandbox/restrict client code: Grier et al. Oakland’08, Reis et al. EuroSys’09, Wang et al. Usenix’09, Vikram et al. Oakland’09, Chong et al. CCS’09, …