Mutation Based SQL Injection Test Cases Generation for the Web Based Application Vulnerability Testing

Ilies Benikhlef, Chenghong Wang, Gulomjon Sangirov2016

Abstract

Security testing is the process of detecting exploited defects that facilitate attacks. SQL Injection (SQLi) vulnerabilities remain one of the most common threats to web-based applications, occurring when untrusted inputs are accepted as database queries. This can lead to unauthorized data access, authentication bypass, and administrative privilege escalation. Despite widespread awareness, manual testing is time-consuming and automated scanners often fail to detect sophisticated, obfuscated attacks. This paper proposes an automated approach using mutation-based test case generation to create a robust set of SQLi attacks. By applying mutation operators to existing attack patterns, we can significantly expand the test space, identify unexpected application behaviors, and improve the overall quality of security assessments.

Introduction

SQL Injection remains a persistent threat because attackers constantly evolve their techniques to bypass signature-based security measures. Traditional vulnerability scanners often rely on static databases of known attack strings, which are easily evaded through obfuscation. Manual penetration testing, while effective, is a significant bottleneck in the development lifecycle due to the expertise and time required. To address these challenges, this research explores the automation of "evasive" test case generation through mutation testing, mimicking the behavior of sophisticated attackers who modify standard queries to slip past web application firewalls (WAFs).

Methodology

The core methodology involves taking a small set of original SQLi attack queries and applying systematic mutation operators to create "mutants." These mutations are categorized into three primary types:

  1. Value Mutations: Modifying constant values (e.g., boundary testing with extremely large or small integers).
  2. Decision Mutations: Altering logical or arithmetic operators (e.g., changing AND to OR).
  3. Statement Mutations: Deleting or duplicating query components to test for syntax-based evasion.

A critical component of this approach is the use of evasion modes. These techniques obfuscate the intent of the query using various encoding and syntax manipulations, as detailed in the table below:

Table 1: Examples of evasion techniques used to mutate a standard SQL query.

The researchers distinguish between Strong, Weak, and Firm mutations. A "Strong" mutation is defined as one that successfully reaches the vulnerable code and triggers a detectable change in the application's state or output, indicating a high-quality test case.

Experimental Evaluation and Results

The proposed method was evaluated using initial test sets from three prominent open-source security benchmarks: FuzzDB, WFuzz, and JbroFuzz. These generated mutants were then tested against five open-source web applications across 20 different vulnerability scenarios.

The results demonstrate a dramatic increase in the volume of effective test cases. By applying mutation algorithms, the number of "Strong" mutants—those capable of triggering a vulnerability—expanded significantly compared to the original, non-mutated sets.

Figure 1: Comparison of "Weak" vs. "Strong" test cases before (Original) and after (Mutated) the mutation process across three different benchmarks.

As illustrated in Figure 1, the mutation process (right-hand columns) yielded hundreds of strong test cases where the original sets (left-hand columns) often provided fewer than twenty. This suggests that mutation testing can uncover a much wider array of potential attack vectors than standard brute-force or signature-based tools.

Conclusion

Mutation-based generation provides a powerful framework for enhancing web application security testing. By automating the creation of complex, evasive SQLi queries, security teams can achieve higher coverage and identify flaws that traditional scanners miss. However, the approach faces challenges regarding computational cost, as every mutant must be executed and analyzed. Future research will focus on optimizing the selection process to prioritize the most promising mutants and minimize the impact of redundant or equivalent mutations.

Summary updated

BibTeX
@misc{benikhlef2016mutation,
  author = {Ilies Benikhlef and Chenghong Wang and Gulomjon Sangirov},
  title = {{Mutation Based SQL Injection Test Cases Generation for the Web Based Application Vulnerability Testing}},
  year = {2016},
  doi = {10.2991/icence-16.2016.104},
}
Figure