Universidade de Coimbro
Blended Security Analysis for Web Applications: Techniques and Tools
Abstract
dc:description.abstractWith the advent of the Internet and Information Society, the popularity of web applications is increasing, resulting in rapid information growth and a clear impact on security aspects. In fact, web applications are frequently deployed with critical security vulnerabilities that, when exploited, may have a huge negative effect on the business. At the same time, headlines regularly chronicle technology based issues such as security hacks, inappropriate or illegal surveillance, misuse of personal data and spread of misinformation. The distrust these incidents breed in stakeholders, whether customers, employees, partners, investors, or regulators, can significantly damage the reputation of an organization. This thesis addresses the problem of vulnerability detection in web applications, proposing new techniques and tools to significantly increase the detection rate of vulnerabilities while keeping the number of false positives low. For demonstration purposes, the work focuses on WordPress plugins and on the PHP language. WordPress is developed in PHP and it is the most popular Content Management System (CMS) nowadays, being used by 43.1% of all the websites (as of December 19th, 2021), which corresponds to a CMS market share of 65.2%. The WordPress environment has more vulnerabilities than any other CMS. In fact, according to data from WPScan, approximately 97% of vulnerabilities in their database are related to WordPress plugins and themes and only 4% are core software. Our first contribution is a Static Application Security Testing (SAST) tool, named phpSAFE, able to analyze PHP code in complex web applications that use Object-Oriented Programming (OOP) and are based on third-party plugins. phpSAFE is a follow-up of a project whose development was requested by Automattic, the developer of WordPress, with the goal of improving the security of the plugins. Unlike other tools, phpSAFE is deployed with a default configuration focusing on generic Cross-Site Scripting (XSS) and SQL Injection (SQLi) vulnerabilities, as well as on plugins of the WordPress framework. This solution, out-of-the-box, has the advantage of allowing the immediate use of the tool to analyze PHP code, either from applications or WordPress plugins without requiring further configuration. It may be used both by occasional developers and by professional software houses wanting to speed up the development process of more secure software and reducing costs by avoiding the use expensive commercial SAST tools. The second key contribution is a new benchmarking methodology for SAST tools for web security that considers four scenarios of criticality and uses evaluation metrics tuned for each scenario. This methodology can be used to compare and rank different SAST tools for detecting vulnerabilities in web applications according to different vulnerability detection requirements. In this context, a benchmark consists of four components: scenarios, workload, metrics, and procedures and rules. In practice, we consider four scenarios (highest-quality, high-quality, medium-quality and low-quality) to compose the workload by assigning representative applications to each scenario based on code quality, and rely on a main metric and a tiebreaker metric for characterizing the tools under evaluation in each scenario. The main metric is used to rank the SAST tools and the tiebreaker metric is used to decide eventual ties between two or more SAST tools. We created two concrete instances of the general benchmarking methodology to demonstrate its feasibility, and evaluated and compared five SAST tools for the detection of SQLi and XSS vulnerabilities in a workload composed of 134 WordPress plugins. Results show that, our benchmarking approach is a valuable tool to help project managers choosing the best SAST tool for a specific project, according to their needs and the resources available. Another contribution consists on case studies on the combination of the results of five SAST tools for SQLi and XSS vulnerabilities, as a way to improve the vulnerability detection rate while keeping False Positives (FPs) low. First, we conducted an experimental campaign using 1-out-of-n adjudication on the outputs of the SAST tools on a dataset of real WordPress plugins. The main limitation observed is the potential increase of FPs, which may be unacceptable in many situations. Thus, we conducted an empirical study looking at the results of all the possible 1-out-of-n, n-out-of-n and majority voting configurations. This way, we collect more evidence on the interplay between FPs and False Negatives (FNs) in diverse SAST configurations, being able to rank the best combination of tools. Finally, we performed an in-deep analysis of code of the WordPress plugins to find reasons to justify why some SAST tools do not detect vulnerabilities that other SAST tools detect. The thesis ends with the proposal of a generic methodology for blending static and dynamic analysis for web application vulnerability detection. The methodology combines static analysis, a crawling procedure and dynamic analysis into a number of steps in order to obtain a set of vulnerabilities, reported by the static analysis, that are confirmed to be exploitable. In short, the process starts with Static Analysis (SA) to produce a list of candidate vulnerabilities. Then, the application is executed automatically, stopping only when the code where the vulnerabilities are located is run. A set of specific inputs and configuration options are automatically generated from the results of the SA and the runtime information collected, which are used to guide the Dynamic Analysis (DA) in the process of successfully exploiting each vulnerability reported by the SA. Results show that, our approach is a great improvement for security practitioners, over using only SA and manual review, because it reduces the usual need for manual reviews of the output of SAST tools.
Author and committee
dc:creator, dc:contributor.*- Author dc:creator
-
- Nunes, Paulo Jorge Costa
- Advisors dc:contributor.advisor
-
- Fonseca, José Carlos
- Vieira, Marco
Subjects
dc:subject × 16Rights
dc:rights- Statement dc:rights
-
- openAccess
- Language dc:language.iso
- eng
Identifiers
dc:identifier.*- Dc Identifier Tid
- 101686315