An Analysis Framework for Security in Web Applications Gary Wassermann and Zhendong Su University of California, Davis.

Slides:



Advertisements
Similar presentations
Understand Database Security Concepts
Advertisements

How Did I Steal Your Database Mostafa
-Ajay Babu.D y5cs022.. Contents Who is hacker? History of hacking Types of hacking Do You Know? What do hackers do? - Some Examples on Web application.
Sania: Syntactic and Semantic Analysis for Automated Testing against SQL Injection Yuji Kosuga, Kenji Kono, Miyuki Hanaoka Keio University Miho Hishiyama,
The Essence of Command Injection Attacks in Web Applications Zhendong Su and Gary Wassermann Present by Alon Kremer April 2011.
Introduction The concept of “SQL Injection”
By Brian Vees.  SQL Injection  Username Enumeration  Cross Site Scripting (XSS)  Remote Code Execution  String Formatting Vulnerabilities.
SQL Injection Attacks Prof. Jim Whitehead CMPS 183: Spring 2006 May 17, 2006.
Sound and Precise Analysis of Web Applications for Injection Vulnerabilities Gary Wassermann Zhendong Su.
1. What is SQL Injection 2. Different varieties of SQL Injection 3. How to prevent it.
Database Connectivity Rose-Hulman Institute of Technology Curt Clifton.
Sound and Precise Analysis of Web Applications for Injection Vulnerabilities Gary Wassermann and Zhendong Su UC Davis Slides from
DePaul Bears Try Your Luck!. Why buy this product? Approximately 1,000,000 cell phone users Approximately 2,000,000 or more people play the lottery New.
SQL Injection Attacks CS 183 : Hypermedia and the Web UC Santa Cruz.
Web Application Vulnerabilities Checklist. EC-Council Parameter Checklist  URL request  URL encoding  Query string  Header  Cookie  Form field 
STOCKDOC Advanced Stock Management System
Sql Server Advanced Features MIS 424 Professor Sandvig.
Web-based Document Management System By Group 3 Xinyi Dong Matthew Downs Joshua Ferguson Sriram Gopinath Sayan Kole.
{ Code Injection Cable Johnson.  Overview  Common Injection Types  Developer Prevention Code Injection.
Check That Input Preventing SQL Injection Attacks By Andrew Morton For CS 410.
SQL Injection Timmothy Boyd CSE 7330.
MIS Week 11 Site:
Analysis of SQL injection prevention using a proxy server By: David Rowe Supervisor: Barry Irwin.
CSCI 6962: Server-side Design and Programming Secure Web Programming.
Lecture 14 – Web Security SFDV3011 – Advanced Web Development 1.
AMNESIA: Analysis and Monitoring for NEutralizing SQL- Injection Attacks Published by Wiliam Halfond and Alessandro Orso Presented by El Shibani Omar CS691.
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.
Chapter 2. Core Defense Mechanisms. Fundamental security problem All user input is untrusted.
Analysis of SQL injection prevention using a proxy server By: David Rowe Supervisor: Barry Irwin.
Security Scanners Mark Shtern. Popular attack targets Web – Web platform – Web application Windows OS Mac OS Linux OS Smartphone.
SQL injection Figure 1 By Kaveri Bhasin. Motive of SQL Injection Obtain data from database Modify system functions Insert data in the backend database.
CANDID : Preventing SQL Injection Attacks Using Dynamic Candidate Evaluations V. N. Venkatakrishnan Assistant Professor, Computer Science University of.
Attacking Data Stores Brad Stancel CSCE 813 Presentation 11/12/2012.
Analysis of SQL injection prevention using a filtering proxy server By: David Rowe Supervisor: Barry Irwin.
SQL Injection Jason Dunn. SQL Overview Structured Query Language For use with Databases Purpose is to retrieve information Main Statements Select Insert.
SQL INJECTIONS Presented By: Eloy Viteri. What is SQL Injection An SQL injection attack is executed when a web page allows users to enter text into a.
Sumanth M Ganesh B CPSC 620.  SQL Injection attacks allow a malicious individual to execute arbitrary SQL code on your server  The attack could involve.
Aniket Joshi Justin Thomas. Agenda Introduction to SQL Injection SQL Injection Attack SQL Injection Prevention Summary.
Building Secure Web Applications With ASP.Net MVC.
SQL – Injections Intro. Prajen Bhadel College of Information Technology & Engeneering Kathmandu tinkune Sixth semister.
Security Considerations Steve Perry
DataFlow Diagram – Level 0
WEB SECURITY WEEK 2 Computer Security Group University of Texas at Dallas.
1 ECE 4112 Internetwork Security: Web Application Security 28 April 2005 John Owens Shantan Pesaru.
Web Security Lesson Summary ●Overview of Web and security vulnerabilities ●Cross Site Scripting ●Cross Site Request Forgery ●SQL Injection.
Database Security Cmpe 226 Fall 2015 By Akanksha Jain Jerry Mengyuan Zheng.
System Modules Overview
Module: Software Engineering of Web Applications Chapter 3 (Cont.): user-input-validation testing of web applications 1.
SQL Injection Anthony Brown March 4, 2008 IntroductionQuestionsBackgroundTechniquesPreventionDemoConclusions.
Secure Authentication. SQL Injection Many web developers are unaware of how SQL queries can be tampered with SQL queries are able to circumvent access.
SQL Injection Attacks An overview by Sameer Siddiqui.
ADVANCED SQL.  The SQL ORDER BY Keyword  The ORDER BY keyword is used to sort the result-set by one or more columns.  The ORDER BY keyword sorts the.
SQL INJECTION Lecturer: A.Prof.Dr. DANG TRAN KHANH Student :Le Nguyen Truong Giang.
SQL Injection Attacks S Vinay Kumar, 07012D0506. Outline SQL Injection ? Classification of Attacks Attack Techniques Prevention Techniques Conclusion.
Introduction SQL Injection is a very old security attack. It first came into existence in the early 1990's ex: ”Hackers” movie hero does SQL Injection.
SQL INJECTION Diwakar Kumar Dinkar M.Tech, CS&E Roll Diwakar Kumar Dinkar M.Tech, CS&E Roll
SQL Injection Attacks.
Database System Implementation CSE 507
Module: Software Engineering of Web Applications
Building Secure ColdFusion Applications
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
Theodore Lawson CSCE548 Student Presentation, Topic #2
SQL INJECTION ATTACKS.
SQL Injection Attacks Many web servers have backing databases
Pengantar Keamanan Informasi
Intro to Ethical Hacking
Chapter 13 Security Methods Part 3.
Lecture 2 - SQL Injection
Web Programming Language
Intro to Ethical Hacking
Presentation transcript:

An Analysis Framework for Security in Web Applications Gary Wassermann and Zhendong Su University of California, Davis

Web Application Architecture Web browser Application Database User input Database query Application generates query based on user input Result set Web page

Command Injection Attacks String query = “SELECT * FROM users WHERE username = ‘” + strUName + “’ AND password = ‘” + strPasswd + “’;”; Expected input: SELECT * FROM users WHERE username = ‘John’ AND password = ‘JohnsPass’; Result: John logs in

Command Injection Attacks Malicious input: SELECT * FROM users WHERE username = ‘’ AND password = ‘’ OR ‘’ = ‘’; Result: Malicious user logs in as first user identified in the database. Frequently, the administrator! String query = “SELECT * FROM users WHERE username = ‘” + strUName + “’ AND password = ‘” + strPasswd + “’;”;

Motivation ~60% of web applications are vulnerable Found vulnerable sites easily in web search Many ways to regulate user inputs Limit length of input Filter out “bad” strings Escape quotes, etc. Are the regulations sufficient? Goal: Check whether any “dangerous” queries, not user inputs, exist

Example: change admin password Attacker registers online: Username: admin’-- Password: password INSERT INTO users VALUES(‘admin’’--’, ‘password’)

Attacker changes password: Username: admin’-- OldPass: password NewPass: backdoor Example: change admin password

Application checks correctness of old password: sql = “SELECT * FROM users WHERE username = ‘admin’’--’ AND password = ‘password’”; rso.open( sql, cn ); if (rso.EOF) {...} Example: change admin password

Admin’s password gets changed: sql = “UPDATE users SET password = ‘” + newpass + “’ WHERE username = ‘” + rso(“username”) + “’”; UPDATE users SET password = ‘backdoor’ WHERE username = ‘admin’--’ Example: change admin password

Overview of Analysis Framework Abstract Model of Generated Programs Structure Discovery Access Control Ex: “customer” deletes inventory data Tautologies Ex: malicious user bypasses authentication Application code query =… Table lists Conditional expressions Select statement

String query = “SELECT * FROM stock WHERE ” + strID + “ = id”; for( int i = 0; i < dat.length(); i++) query = query + “ AND ” + dat[i] + “ = “ + inp[i]; Example with cycles String query = “SELECT * FROM stock WHERE ” + strID + “ = id”;

String query = “SELECT * FROM stock WHERE ” + strID + “ = id”; for( int i = 0; i < dat.length(); i++) query = query + “ AND ” + dat[i] + “ = “ + inp[i]; Example with cycles from dropdown menu year min dat

String query = “SELECT * FROM stock WHERE ” + strID + “ = id”; for( int i = 0; i < dat.length(); i++) query = query + “ AND ” + dat[i] + “ = “ + inp[i]; Example with cycles from dropdown menu from textbox year min dat inp

String query = “SELECT * FROM stock WHERE ” + strID + “ = id”; for( int i = 0; i < dat.length(); i++) query = query + “ AND ” + dat[i] + “ = “ + inp[i]; Example with cycles year min dat inp Filtered with  {“delete”, “xp\_”, “=”, “from”, “or”}

String query = “SELECT * FROM stock WHERE ” + strID + “ = id”; for( int i = 0; i < dat.length(); i++) query = query + “ AND ” + dat[i] + “ = “ + inp[i]; Example with cycles year min dat inp SELECT * FROM stock WHERE 982 = id AND year = 2004 AND min = 15 Filtered with  {“delete”, “xp\_”, “=”, “from”, “or”}

String query = “SELECT * FROM stock WHERE ” + strID + “ = id”; for( int i = 0; i < dat.length(); i++) query = query + “ AND ” + dat[i] + “ = “ + inp[i]; Example with cycles min dat 14 15) inp SELECT * FROM stock WHERE NOT(1 = id AND min = 14 AND min = 15) Filtered with  {“delete”, “xp\_”, “=”, “from”, “or”}

String Analysis (previous work) )=zid=(xminANDNOT stock WHERE FROMSELECT* = miny ε SELECT * FROM stock WHERE NOT(1 = id AND min = 14 AND min = 15)

Structure Discovery (previous work) )=zid=(xminANDNOT WHERE = miny ε stockFROMSELECT* Boolean expression

Tautology checking )=zmin WHERE id=(xANDNOT = miny ε stockFROMSELECT* NOT ( x = id and min = y and min = z ) Theorem: We discover a tautology over linear arithmetic iff the FSA accepts one.

Overview of Tautology Checking Main idea: Generate finite number of validity queries from FSA Challenges: Loops/cycles Arithmetic Boolean

Tautology Checking: Arithmetic Loops  W,X,Y,Z : 1 = W+X Æ X+W+Y = Y+Z Æ Z = 1 a,b,ca,b,c W × ( a ) + X × ( b ) + Y × ( c ) ≥ Z × ( b+c ) +c+cb ≥ a +c+c b in = 1 W X Y Z out = 1 { W, Y, Z ← 1; X ← 0} b+c ≥ b+c

Tautology Checking: Boolean Loops a bb OR a bb a bb a bb a bb n+2 = 4

UPDATE users SET password = ‘backdoor’ WHERE username = ‘admin’--’ Earlier Example Revisited -- =‘password WHERE SETUPDATEusers’ =username w ‘ ’ x’

sql = “UPDATE users SET password = ‘” + newpass + “’ WHERE username = ‘” + rso(“username”) + “’”; Earlier Example Revisited This code may also generate a query with a tautology UPDATE users SET password = ‘backdoor’ WHERE username = ‘’OR‘a’=‘a’;

Earlier Example Revisited =‘password WHERE SETUPDATEusers’ =username w ‘’x=‘’zOR‘’y UPDATE users SET password = ‘backdoor’ WHERE username = ‘’OR‘a’=‘a’;

Conclusions Analysis Framework: Generate and analyze FSA model of all possible queries Semantic analysis of generated programs Not only types but values Implementation in progress Questions?

Why n+2?