Module: Software Engineering of Web Applications

Slides:



Advertisements
Similar presentations
Cross-Site Scripting Issues and Defenses Ed Skoudis Predictive Systems © 2002, Predictive Systems.
Advertisements

What is code injection? Code injection is the exploitation of a computer bug that is caused by processing invalid data. Code injection can be used by.
HI-TEC 2011 SQL Injection. Client’s Browser HTTP or HTTPS Web Server Apache or IIS HTML Forms CGI Scripts Database SQL Server or Oracle or MySQL ODBC.
Lecture 6/2/12. Forms and PHP The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input When dealing with HTML forms.
Creating Stronger, Safer, Web Facing Code JPL IT Security Mary Rivera June 17, 2011.
WebGoat & WebScarab “What is computer security for $1000 Alex?”
Cross Site Scripting a.k.a. XSS Szymon Siewior. Disclaimer Everything that will be shown, was created for strictly educational purposes. You may reuse.
Introduction The concept of “SQL Injection”
By Brian Vees.  SQL Injection  Username Enumeration  Cross Site Scripting (XSS)  Remote Code Execution  String Formatting Vulnerabilities.
Chapter 9 Web Applications. Web Applications are public and available to the entire world. Easy access to the application means also easy access for malicious.
Information Networking Security and Assurance Lab National Chung Cheng University The Ten Most Critical Web Application Security Vulnerabilities Ryan J.W.
Leveraging User Interactions for In-Depth Testing of Web Applications Sean McAllister, Engin Kirda, and Christopher Kruegel RAID ’08 1 Seoyeon Kang November.
SQL Injection and Buffer overflow
Injection Attacks by Example SQL Injection and XSS Adam Forsythe Thomas Hollingsworth.
Expert System Approach on Web Vulnerability Analysis / Jong Heon, PARK / Hyun Woo, CHO CS548 Advanced Information Security Term Project.
Introduction to Application Penetration Testing
+ Websites Vulnerabilities. + Content Expand of The Internet Use of the Internet Examples Importance of the Internet How to find Security Vulnerabilities.
CSCI 6962: Server-side Design and Programming Secure Web Programming.
Lecture 14 – Web Security SFDV3011 – Advanced Web Development 1.
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.
Chapter 9 Web Applications. Web Applications are public and available to the entire world. Easy access to the application means also easy access for malicious.
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.
Lecture slides prepared for “Computer Security: Principles and Practice”, 3/e, by William Stallings and Lawrie Brown, Chapter 5 “Database and Cloud Security”.
COMP3121 E-Commerce Technologies Richard Henson University of Worcester November 2011.
Security+ Guide to Network Security Fundamentals, Fourth Edition
Web Application Security ECE ECE Internetwork Security What is a Web Application? An application generally comprised of a collection of scripts.
Security Scanners Mark Shtern. Popular attack targets Web – Web platform – Web application Windows OS Mac OS Linux OS Smartphone.
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.
OWASP Top Ten #1 Unvalidated Input. Agenda What is the OWASP Top 10? Where can I find it? What is Unvalidated Input? What environments are effected? How.
Analysis of SQL injection prevention using a filtering proxy server By: David Rowe Supervisor: Barry Irwin.
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.
Input Validation – common associated risks  ______________ user input controls SQL statements ultimately executed by a database server
Web Applications Testing By Jamie Rougvie Supported by.
Building Secure Web Applications With ASP.Net MVC.
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.
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.
Security Attacks CS 795. Buffer Overflow Problem Buffer overflow Analysis of Buffer Overflow Attacks.
Module: Software Engineering of Web Applications Chapter 3: user-input-validation testing of web applications 1.
Copyright © The OWASP Foundation This work is available under the Creative Commons SA 2.5 license The OWASP Foundation OWASP Denver February 2012.
Module: Software Engineering of Web Applications Chapter 3 (Cont.): user-input-validation testing of web applications 1.
INFO 344 Web Tools And Development CK Wang University of Washington Spring 2014.
Introduction of XSS:-- Cross-Site Scripting (XSS) attacks are a type of injection, in which malicious scripts are injected into otherwise benign and trusted.
Example – SQL Injection MySQL & PHP code: // The next instruction prompts the user is to supply an ID $personID = getIDstringFromUser(); $sqlQuery = "SELECT.
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,
Carrie Estes Collin Donaldson.  Zero day attacks  “zero day”  Web application attacks  Signing up for a class  Hardening the web server  Enhancing.
Page 1 Ethical Hacking by Douglas Williams. Page 2 Intro Attackers can potentially use many different paths through your application to do harm to your.
SlideSet #20: Input Validation and Cross-site Scripting Attacks (XSS) SY306 Web and Databases for Cyber Operations.
Web Security (cont.) 1. Referral issues r HTTP referer (originally referrer) – HTTP header that designates calling resource  Page on which a link is.
XSS 101 Jason Clark 12/20.
Database and Cloud Security
Web Application Security
Module: Software Engineering of Web Applications
CSCE 548 Student Presentation Ryan Labrador
Web Application Vulnerabilities
TMG Client Protection 6NPS – Session 7.
Module: Software Engineering of Web Applications
Web Application Vulnerabilities, Detection Mechanisms, and Defenses
TOPIC: Web Security (Part-4)
World Wide Web policy.
Static Detection of Cross-Site Scripting Vulnerabilities
Marking Scheme for Semantic-aware Web Application Security
PHP: Security issues FdSc Module 109 Server side scripting and
Lecture 2 - SQL Injection
Web Programming Language
CS5123 Software Validation and Quality Assurance
Cross-Site Scripting Issues and Defenses Ed Skoudis Predictive Systems
Exploring DOM-Based Cross Site Attacks
Presentation transcript:

Module: Software Engineering of Web Applications user-input-validation testing of web applications

UIV User-input-validation (UIV) is the first barricade that protects a web application from application-level attacks such as buffer overflow, code-injection attack, hidden-field manipulation, and cross-site scripting. Attackers can launch these attacks by sending malicious inputs to a web application. UIV protects a web application against these attacks by rejecting malicious inputs. improving the quality of UIV is a key means of enhancing a web application’s security. These slides are designed to accompany module: Software Engineering of Web Applications

Problem Unfortunately, web-application developers usually forget to implement UIV, or implement defective UIV. As shown in a recent survey (Open Web Application Security Project, 2013), among the top 10 vulnerabilities of web applications, six vulnerabilities are induced by defective UIV. There is a strong need of an effective way to help improve the quality of UIV, thereby increasing web applications’ security. These slides are designed to accompany module: Software Engineering of Web Applications

UIV testing UIV testing is a common way in practice to improve the quality of UIV. There exist tools (Nikto2, 2008; Wikto, 2008; Acunetix Web Vulnerability Scanner, 2008; Fiddler, 2009; Burp Proxy, 2009; Tamperie, 2009) that test UIV of web applications. These existing tools can be classified into two major categories: crawler-based (Nikto2, 2008; Wikto, 2008; Acunetix Web Vulnerability Scanner, 2008) and proxy-based (Fiddler, 2009; Burp Proxy, 2009; Tamperie, 2009) UIV testing tools. These slides are designed to accompany module: Software Engineering of Web Applications

Crawler-based UIV testing tools Crawler-based UIV testing tools retrieve HTML pages automatically, and submit predefined test inputs to the server through these HTML pages. However, using only predefined test inputs may not be suitable to be used for a particular input field. These slides are designed to accompany module: Software Engineering of Web Applications

Example For example, consider that an input field in a web application may require a year value to be between 1999 and 2003. To test this input field, we shall enter possible boundary values such as 1998 or 2004. These boundary values may not exist in the predefined test inputs; hence, it may not be possible to check whether the web application can deal with the boundary values properly. These slides are designed to accompany module: Software Engineering of Web Applications

As a result, crawler-based testing tools cannot detect these semantics-related UIV defects. semantic-related UIV defects to refer to defects that are induced due to the lack of checking the semantics of inputs, and semantic-related test inputs are test inputs that can detect semantic-related UIV defects. These slides are designed to accompany module: Software Engineering of Web Applications

proxy-based UIV testing tools Different from crawler-based UIV testing tools, proxy-based UIV testing tools allow developers to edit HTML requests directly. These tools basically provide a manual testing approach, which keeps the maximum flexibility without providing any help on test input generation. These manual steps are tedious, and the creation of test inputs heavily depends on developers’ knowledge and experience. These slides are designed to accompany module: Software Engineering of Web Applications

Weber (2005), a senior security consultant, used Cross-Site Scripting (XSS) as an example to show how to test web applications for such vulnerabilities in practice using the proxy based UIV testing technique. First, a developer finds some proxy tools that can intercept HTTP requests. Second, the developer maps the site and its functionality by discussing with other developers and project managers. These slides are designed to accompany module: Software Engineering of Web Applications

Third, the developer identifies and lists input fields. Fourth, the developer writes test inputs manually. Finally, the developer starts testing with the proxy tools and adjusts test inputs These slides are designed to accompany module: Software Engineering of Web Applications

Vulnerabilities in web applications Existing technologies such as anti-virus software and network firewall offer comparatively secure protection at host and network levels, but not at the application level (Huang et al., 2004). Application-level attacks are more difficult to detect than attacks at host and network levels. These attacks can come from any online user — even authenticated ones. As UIV checks inputs from any on-line user, UIV is an effective means to protect a web application from application-level attacks. These slides are designed to accompany module: Software Engineering of Web Applications

Vulnerabilities in web applications Here, we give a brief introduction of several vulnerabilities in web applications to show how attacks can happen at the application level because of defective UIV. These slides are designed to accompany module: Software Engineering of Web Applications

1- Hidden fields Hidden fields refer to hidden HTML form fields, such as (input type=hidden name=hl value=“en”). In many web applications, developers use these fields to transfer values instead of presenting these values to users. Unfortunately, these fields are actually visible and manipulable to users. Malicious users could easily change the values of these fields in HTML source code and send the changed values back to the web application. These slides are designed to accompany module: Software Engineering of Web Applications

Hidden fields If a web application uses a hidden field to hold merchandise prices, malicious users could purchase items at little or no cost. These attacks could be successful because a web application may not validate whether the returning value of a hidden field is the same as its outgoing value, and accepts the illegally changed value. These slides are designed to accompany module: Software Engineering of Web Applications

2- Cross-Site Scripting Cross-Site Scripting (XSS) flaws occur when a web application accepts user-supplied inputs that contain browser-executable scripts, and posts the inputs in an HTML page without validating or encoding. When another user accesses the HTML page, the web browser executes scripts posted in that HTML page. Through XSS, attackers could send an executable script to a victim’s browser, and then possibly hijack user sessions, deface websites, introduce worms, etc. These slides are designed to accompany module: Software Engineering of Web Applications

Cross-Site Scripting Fig. 1 shows a typical XSS example, which is borrowed from the “Writing Secure Code” book (Howard and LeBlanc, 2003). Suppose that an attacker sends the code shown in Fig. 1 to a bulletin board, and then an innocent user opens that bulletin board and clicks the hyper link of “Click here!”. As a result, this user’s cookie would be stolen. Such attacks could be successful when the web application does not filter out or transform scripts included in users’ inputs. These slides are designed to accompany module: Software Engineering of Web Applications

Cross-Site Scripting These slides are designed to accompany module: Software Engineering of Web Applications

3- SQL injection SQL injection flaws occur when user-supplied inputs are sent to an interpreter as part of a command or query. Attackers trick the interpreter to execute unintended commands via supplying specially crafted data For example, consider a web application that authenticates a user by checking a database in this way: These slides are designed to accompany module: Software Engineering of Web Applications

SQL injection SQLQuery = “SELECT * FROM Users WHERE (UserName=’ “+ strUserName +”’) AND (Password=’ “+ strPassword +”’);”; if GetQueryResult(SQLQuery) == 0 then authenticated = false; else authenticated = true; If an attacker enters X’ OR ‘A’ =’A for UserName and X’ OR ‘A’ =’A for Password and the web application executes the query on the database directly, the SQL statement at runtime becomes: SELECT ∗ FROM Users WHERE(UserName = ‘X’ OR‘A’ = ‘A’) AND(Password = ‘X’ OR‘A’ = ‘A’); These slides are designed to accompany module: Software Engineering of Web Applications

SQL injection In this way, the attacker bypasses the authentication and accesses all the user information in the Users table. Similar to XSS attacks, SQL-injection attacks could be successful if the web application does not filter or transform SQL commands included in users’ inputs. These slides are designed to accompany module: Software Engineering of Web Applications

4- Unconscious mistakes Besides the preceding malicious attacks, many users can enter invalid inputs unconsciously. For example, users may enter invalid characters, such as multiple blanks, &, and null accidentally. These characters may lead to a failure or even crash when they are used for database operations. These slides are designed to accompany module: Software Engineering of Web Applications

Unconscious mistakes Even though such inputs may not crash a web application, there can be a negative user experience. For example, when a user signs up for a service, a web application requires the user’s email address, and sends an automatically generated password to that email address. If the user enters an invalid email address, the user does not get the password and the service sign up fails. These slides are designed to accompany module: Software Engineering of Web Applications

Solution To avoid these vulnerabilities, a web application should validate a user input before using the input for further processing. However, web-application developers often forget validating users’ inputs, and UIV is often not correctly developed. These slides are designed to accompany module: Software Engineering of Web Applications

Reference Li, N., Xie, T., Jin, M. & Liu, C., 2010. Perturbation-based user-input-validation testing of web applications. The Journal of Systems and Software, 83(11), pp. 2263-2274. These slides are designed to accompany module: Software Engineering of Web Applications