Detecting Cross-Site Scripting Vulnerabilities through Automated Unit Testing

04/02/2018
by   Mahmoud Mohammadi, et al.
0

The best practice to prevent Cross Site Scripting (XSS) attacks is to apply encoders to sanitize untrusted data. To balance security and functionality, encoders should be applied to match the web page context, such as HTML body, JavaScript, and style sheets. A common programming error is the use of a wrong encoder to sanitize untrusted data, leaving the application vulnerable. We present a security unit testing approach to detect XSS vulnerabilities caused by improper encoding of untrusted data. Unit tests for the XSS vulnerability are automatically constructed out of each web page and then evaluated by a unit test execution framework. A grammar-based attack generator is used to automatically generate test inputs. We evaluate our approach on a large open source medical records application, demonstrating that we can detect many 0-day XSS vulnerabilities with very low false positives, and that the grammar-based attack generator has better test coverage than industry best practices.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/03/2018

Automated Detecting and Repair of Cross-Site Scripting Vulnerabilities

The best practice to prevent Cross Site Scripting (XSS) attacks is to ap...
research
04/02/2018

Automatic Web Security Unit Testing: XSS Vulnerability Detection

Integrating security testing into the workflow of software developers no...
research
04/02/2018

Using Unit Testing to Detect Sanitization Flaws

Input sanitization mechanisms are widely used to mitigate vulnerabilitie...
research
03/05/2023

Minimize Web Applications vulnerabilities through the early Detection of CRLF Injection

Carriage return (CR) and line feed (LF), also known as CRLF injection is...
research
12/11/2019

Metamorphic Security Testing for Web Systems

Security testing verifies that the data and the resources of software sy...
research
08/19/2022

Metamorphic Testing for Web System Security

Security testing aims at verifying that the software meets its security ...
research
05/07/2020

Database Traffic Interception for Graybox Detection of Stored and Context-Sensitive XSS

XSS is a security vulnerability that permits injecting malicious code in...

Please sign up or login with your details

Forgot password? Click here to reset