TL;DR
This paper introduces JoanAudit, a static analysis tool designed to help security auditors efficiently find common injection vulnerabilities (like XSS and SQL injection) in Java web applications. By employing a novel "security slicing" technique, JoanAudit significantly reduces the amount of code auditors need to inspect, focusing their attention on the most critical parts.
What Problem Does This Paper Address?
Web applications are constantly under threat from various injection vulnerabilities, such as Cross-Site Scripting (XSS), SQL Injection (SQLi), and XML Injection (XMLi). These vulnerabilities arise when untrusted user input is not properly handled and is instead passed to sensitive "sink" functions, allowing attackers to inject malicious code. While security auditing is crucial for detecting these flaws early in development, manually inspecting large codebases is time-consuming, error-prone, and simply not scalable. Existing automated tools often struggle to pinpoint vulnerabilities precisely, provide actionable reports, or handle the sheer size of modern web applications.
Methods
JoanAudit tackles these challenges by implementing a technique called "security slicing." Here's how it works:
- System Dependence Graph (SDG): The tool first builds an SDG from the Java bytecode. This graph captures inter-procedural data, control, and call dependencies, providing a comprehensive model of the program's structure.
- Input Sources and Sinks: JoanAudit is configured with a list of known "input sources" (e.g., functions that read user input) and "sinks" (e.g., functions that execute queries or render output).
- Security Slicing: Instead of generating full program slices, JoanAudit creates "security slices." These slices are minimal sets of program statements that are relevant to a specific vulnerability path, from an input source to a sink. This is achieved by:
- Pruning irrelevant code: Functions known to be secure or irrelevant to security are removed early.
- Information Flow Control (IFC) Analysis: This step checks if sanitization functions are correctly used to neutralize potential threats along a path.
- Context Analysis: This further refines the slices by understanding the context in which data is used, allowing for automatic fixing of some vulnerabilities.
- Automated Fixing: For certain cases where input is directly used in a sink without sanitization, JoanAudit can automatically apply standard sanitization procedures.
Datasets
The paper evaluates JoanAudit on nine real-world Java web applications/services. These applications vary in size, with the largest being 52 kLOC (thousand lines of code), which the authors state is typical for such systems. The authors refer to previous work ([39, 40]) for detailed information on the evaluation methodology and specific benchmarks used.
Key Insights and Ideas
- Focusing the Audit: The core idea is that auditors don't need to see the entire codebase. By identifying and presenting only the code directly involved in a potential vulnerability, JoanAudit dramatically narrows the scope of inspection.
- Beyond Taint Analysis: While many tools rely on taint analysis, JoanAudit's security slicing incorporates control-dependency information. This is crucial because conditional statements (like
ifstatements) often handle sanitization, and understanding these control flows is vital to avoid false alarms. - Scalability Through Precision: The precision of security slicing is key to scalability. By eliminating irrelevant code, the tool can handle larger, more realistic applications efficiently.
- Automated Assistance: The ability to automatically fix simple vulnerabilities reduces the manual burden on developers and auditors, accelerating the development lifecycle.
Key Results
The evaluation demonstrates JoanAudit's effectiveness:
- Significant Code Reduction: Security slicing achieved an average reduction of 76% in the number of SDG nodes compared to standard chopping techniques.
- 1% Inspection Target: On average, auditors only need to inspect about 1% of the total application code to audit common injection vulnerabilities.
- Soundness: JoanAudit was found to be sound, meaning it did not miss any security-relevant statements or incorrectly drop valid code paths.
- Scalability: The tool exhibits good performance, with analysis times averaging 27 seconds per subject, making it suitable for large Java web applications.
Limitations and Future Work
- Limitations: While the paper highlights the tool's strengths, the evaluation summary is brief, referring to prior work for full details. The automatic fixing capability is limited to specific, well-defined scenarios.
- Future Work: The authors plan to:
- Adapt JoanAudit to popular Java web frameworks like Spring and Play.
- Integrate it into build management tools (Maven, Gradle).
- Combine security slicing with symbolic execution and string constraint solving for more comprehensive vulnerability detection.
- Conduct user studies to assess its usefulness in industrial settings.
Summary updated