Ben Smith and Laurie Williams

Slides:



Advertisements
Similar presentations
Closing the Gap: Analyzing the Limitations of Web Application Vulnerability Scanners David Shelly Randy Marchany Joseph Tront Virginia Polytechnic Institute.
Advertisements

Network Security Attack Analysis. cs490ns - cotter2 Outline Types of Attacks Vulnerabilities Exploited Network Attack Phases Attack Detection Tools.
Creating Stronger, Safer, Web Facing Code JPL IT Security Mary Rivera June 17, 2011.
ESEM | October 9, 2008 On Establishing a Benchmark for Evaluating Static Analysis Prioritization and Classification Techniques Sarah Heckman and Laurie.
Regression Analysis Once a linear relationship is defined, the independent variable can be used to forecast the dependent variable. Y ^ = bo + bX bo is.
Introduction The concept of “SQL Injection”
Shipi Kankane Prashanth Nakirekommula.  Applying analytics and risk- management capabilities to health insurance through LexisNexis data platforms. 
Software Quality Metrics
Spotting Web Vulnerabilities (from the eyes of an Script Kiddie)
ReferencesReferences DiscussionDiscussion Vulnerability Example: SQL injection Auditing Tool for Eclipse LAPSE: a Security Auditing Tool for Eclipse IntroductionIntroductionResultsResults.
Leveraging User Interactions for In-Depth Testing of Web Applications Sean McAllister, Engin Kirda, and Christopher Kruegel RAID ’08 1 Seoyeon Kang November.
Sara SartoliAkbar Siami Namin NSF-SFS workshop July 14-18, 2014.
BUILDING A SECURE STANDARD LIBRARY Information Assurance Project I MN Tajuddin hj. Tappe Supervisor Mdm. Rasimah Che Mohd Yusoff ASP.NET TECHNOLOGY.
Leveraging User Interactions for In-Depth Testing of Web Application Sean McAllister Secure System Lab, Technical University Vienna, Austria Engin Kirda.
Varun Sharma Security Engineer | ACE Team | Microsoft Information Security
A Comparative Analysis of the Efficiency of Change Metrics and Static Code Attributes for Defect Prediction Raimund Moser, Witold Pedrycz, Giancarlo Succi.
Chapter 2: The Research Enterprise in Psychology
Secure Software Development Mini Zeng University of Alabama in Huntsville 1.
Chapter 2: The Research Enterprise in Psychology
Joel Bapaga on Web Design Strategies Technologies Commercial Value.
Software Quality Assurance Lecture #8 By: Faraz Ahmed.
Hamdi Yesilyurt, MA Student in MSDF & PhD-Public Affaris SQL Riji Jacob MS Student in Computer Science.
(CPSC620) Sanjay Tibile Vinay Deore. Agenda  Database and SQL  What is SQL Injection?  Types  Example of attack  Prevention  References.
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.
1 PHP and MySQL. 2 Topics  Querying Data with PHP  User-Driven Querying  Writing Data with PHP and MySQL PHP and MySQL.
Exploitation: Buffer Overflow, SQL injection, Adobe files Source:
 To explain the importance of software configuration management (CM)  To describe key CM activities namely CM planning, change management, version management.
The Research Enterprise in Psychology. The Scientific Method: Terminology Operational definitions are used to clarify precisely what is meant by each.
CSC-682 Cryptography & Computer Security Sound and Precise Analysis of Web Applications for Injection Vulnerabilities Pompi Rotaru Based on an article.
Introduction To Web Application Security in PHP. Security is Big And Often Difficult PHP doesn’t make it any easier.
REAL TIME GPS TRACKING SYSTEM MSE PROJECT PHASE I PRESENTATION Bakor Kamal CIS 895.
October 3, 2008IMI Security Symposium Application Security through a Hacker’s Eyes James Walden Northern Kentucky University
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.
Building Secure Web Applications With ASP.Net MVC.
Web Application Vulnerabilities ECE 4112 Internetwork Security, Spring 2005 Chris Kelly Chris Lewis April 28, 2005 ECE 4112 Internetwork Security, Spring.
Controlling Web Site Access Using Logins CS 320. Basic Approach HTML form a php page that collects the username and password  Sends them to second PHP.
By Davide Balzarotti Marco Cova Viktoria V. FelmetsgerGiovanni Vigna Presented by: Mostafa Saad.
Chapter 2 The Research Enterprise in Psychology. Table of Contents The Scientific Approach: A Search for Laws Basic assumption: events are governed by.
United Nations Oslo City Group on Energy Statistics OG7, Helsinki, Finland October 2012 ESCM Chapter 8: Data Quality and Meta Data 1.
Preventing MySQL Injection Sonja Parson COSC 5010 Security Presentation April 26, 2005.
Web Security. Introduction Webserver hacking refers to attackers taking advantage of vulnerabilities inherent to the web server software itself These.
INFO 344 Web Tools And Development CK Wang University of Washington Spring 2014.
Identifying “Best Bet” Web Search Results by Mining Past User Behavior Author: Eugene Agichtein, Zijian Zheng (Microsoft Research) Source: KDD2006 Reporter:
1 Idea: Using System Level Testing for Revealing SQL Injection-Related Error Message Information Leaks Ben Smith Laurie Williams Andrew Austin North Carolina.
SQL Injection Josh Mann. What is SQL Injection  SQL injection is a technique for exploiting web applications that use client-supplied data in SQL queries.
Advanced Higher Computing Science The Project. Introduction Worth 60% of the total marks for the course Must include: An appropriate interface using input.
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.
Advanced Higher Computing Science
Detecting Web Attacks Using Multi-Stage Log Analysis
Prepared by: Fatih Kızkun
Database System Implementation CSE 507
Security of Digital Signatures
Name: Sushmita Laila Khan Affiliation: Georgia Southern University
Logistic Regression: To classify gene pairs
Static Detection of Cross-Site Scripting Vulnerabilities
Theodore Lawson CSCE548 Student Presentation, Topic #2
Web Application Security
Unix System Administration
Prof. Dr. Marc Rennhard Head of Information Security Research Group
SQL INJECTION ATTACKS.
Secure Coding Initiative
Intro to Ethical Hacking
PHP: Security issues FdSc Module 109 Server side scripting and
Predict Failures with Developer Networks and Social Network Analysis
Lecture 2 - SQL Injection
Towards a Personal Briefing Assistant
Proposing SQL Statement Coverage Metrics
PHP Forms and Databases.
Exploring Complexity Metrics as Indicators of Software Vulnerability
Presentation transcript:

Ben Smith and Laurie Williams Using SQL Hotspots in a Prioritization Heuristic for Detecting All Types of Web Application Vulnerabilities Ben Smith and Laurie Williams 1

2 Easy for non-technical hackers (script-kiddies) can do this. Selling control for US Government websites that the hacker got by using a SQL injection, a common form of web app vulnerability, to be discussed. Is a form of input validation vulnerability. 2

Input Validation Vulnerabilities There is a plethora of proposed mitigation techniques, no solution eliminates all vulnerabilities. In the CWE/SANS Top 25 for 2009. Continue to be in the CWE/SANS Top 25 for 2010. Also indicated by SANS as the most common attacks for compromising web sites. 3

How do we stop this? Development organizations do not have the time or resources to detect vulnerabilities in every source file before release. Validation and verification must be prioritized to start with vulnerable files first. SQL hotspots may help with this prioritization process. Though typically associated with SQL injection, hotspots may be useful for predicting any type of vulnerability. 4

Goal The goal of this research is to improve the prioritization of security fortification efforts by investigating the ability of SQL hotspots to be used as the basis for a heuristic for the prediction of all vulnerability types. 5

Agenda What are SQL hotspots? Case Studies Projects Methodology Results: Eight Hypotheses about Hotspots Conclusion: A heuristic for prioritizing V&V efforts 6

SQL Hotspot A SQL Hotspot is any point in the application source code where the program interacts with a database management system. Typically indicated with mysql_query() or other library functions in PHP. 7

SQL Hotspots (2) $username = $_POST[‘username’]; $password = $_POST[‘password’]; $result = mysql_query( “select * from users where username = ‘$username’ AND password = ‘$password’”); $firstresult = mysql_fetch_array($result); $role = $firstresult[‘role’]; $_COOKIE[‘userrole’] = $role 8

Study Subjects WordPress WikkaWiki Advanced blog management 74% bloggers run WordPress Uses MySQL and PHP 138,967 SLOC WikkaWiki Wiki management system 532 websites are using WikkaWiki 46,025 SLOC 9

Trac is a bug tracking system that links issue reports to repository changes. 10

CWE Classifications WordPress WikkaWiki 11 Manually classified issue reports with CWE identifiers. 11

Tracing Vulnerabilities to Files WikkaWiki WordPress Analyzed issue reports to trace vulnerabilities to files within releases. X-axis is the release, the y-axis is a histogram of the number of times a file was changed due to a vulnerability. 12

Detecting Hotspots First we detected SQL hotspots using a regular exp matcher. We also included a measure of SLOC. 13

Prediction Model Contained two terms: no. hotspots, SLOC Logistic regression Trained on releases 1…N, tested on release N+1. (1.0 to 1.3, tested on 1.4). tp, tn, fp, fn 14

Descriptive Statistics WordPress WikkaWiki Releases Analyzed Nine Six Security reports analyzed 97 61 Vulnerable files 26% (85 / 326) 29% (44 / 209) Average hotspots 255 92 Average files having at least one hotspot 14.2% 8.42% Used open source tools R to test statistical hypotheses, and Weka for model evaluation. 15

Hypotheses about Files H1: The more hotspots a file contains per line of code, the more likely it is that the file contains any type of web application vulnerability (Logit, p < 0.05). H2: The more hotspots a file contains, the more times that file was changed due to any kind of vulnerability (SLR, p < 0.0001, Adjusted R2 = 0.4208, 0.3802). 16

Hypotheses about Issue Reports H3: Input validation vulnerabilities result in a higher number average repository revisions than any other type of vulnerability. (Consistent with SANS report). Mann-Whitney-Wilcoxon Test (p < 0.05) 17

Hypotheses about Prediction H4: Hotspots can be used to predict files that will contain any type of web application vulnerability in the current release (predictive model that does better than a random guess). H5: The more hotspots a file contains, the more likely that file will be vulnerable in the next release (coefficients on predictive model). 18

Model Performance - WordPress Random guess values actually an average of precision/recall over ten trials. 19

Hypotheses Comparing Projects H6: The average number of hotspots per file is more variable in WordPress than WikkaWiki. (F-test, p < 0.000001) H7: WordPress suffered a higher proportion of input validation vulnerabilities than WikkaWiki. (Chi-Squared Test, p = 0.0692) H8: In WordPress, more lines of code that were changed due to security issues were hotspots than in WikkaWiki. (Chi-Squared Test, p < 0.000001) 20

Limitations We can never find or know all vulnerabilities. Our definition of a hotspot may be insufficient or incorrect. Issue reports were subject to human error both in reporting and in analyzing. We are limited to these two open source projects. 21

Conclusion Hotspots can be used in a V&V prioritization heuristic as follows: More SQL and non-SQL vulnerabilities will be found in files that contain more hotspots per line of code. Input validation vulnerabilities: prominent problem, no single solution. Separating the concern of database interaction is associated with a decrease in the proportion of reported input validation vulnerabilities. 22

Thank you! Any questions? 23

Precision & Recall A measure of the level of exactness exhibited by the model The number of vulnerable files the model retrieves. 24

SQL Injection Attacks ‘ OR 1=1 -- $username = $_POST[‘username’]; $password = $_POST[‘password’]; $result = mysql_query( “select * from users where username = ‘’ OR 1=1 ---’ AND password = ‘$password’”); $firstresult = mysql_fetch_array($result); $role = $firstresult[‘role’]; $_COOKIE[‘userrole’] = $role ‘ OR 1=1 -- 25