Overview
Software is inherently prone to security vulnerabilities. While program analysis tools exist to detect them, their practical effectiveness is often limited by a reliance on human-labeled specifications. Large Language Models (LLMs) have demonstrated impressive code generation capabilities, but they struggle with the complex, whole-repository reasoning required to detect vulnerabilities reliably.
Enter IRIS, a novel neuro-symbolic system that systematically combines the broad API knowledge of LLMs with the rigorous, whole-repository tracking of static analysis. By using LLMs to automatically infer "taint" specifications and filter out false positives, IRIS detects over twice as many vulnerabilities as state-of-the-art tools like CodeQL, and even uncovered four previously unknown zero-day vulnerabilities in popular Java projects.
The Challenge of Static Taint Analysis
Finding security bugs—such as SQL injection or path traversal—often relies on static taint analysis. This technique tracks untrusted user input (the "source") as it flows through a codebase to a dangerous function execution (the "sink").
However, modern software relies heavily on third-party libraries. For a static analysis tool like GitHub's CodeQL to work effectively, human security researchers must manually write rules (specifications) defining which external APIs act as sources or sinks. If a specification is missing, the tool misses the bug (a false negative). Furthermore, even when tools find a path from source to sink, they lack the contextual intuition to know if the path is actually exploitable, leading to a flood of false positives that developers must manually triage.
While LLMs are excellent at reading code and understanding context, they are notoriously bad at whole-repository reasoning—tracking a variable across dozens of files. The authors tackle this gap by asking: How can we combine the whole-repository tracking of static analysis with the contextual reasoning and API knowledge of LLMs?
The IRIS Methodology
The authors propose a pipeline that systematically merges LLMs with static analysis (specifically, CodeQL) across four distinct stages:
- Candidate Extraction: IRIS scans a compiled project to extract all external API calls and internal function parameters.
- Specification Inference (LLM): IRIS feeds batches of these APIs to an LLM, asking it to label them as potential "sources" or "sinks" for a specific vulnerability type (e.g., CWE-22: Path Traversal).
- Static Taint Analysis (CodeQL): These newly minted, LLM-generated specifications are translated into CodeQL queries. CodeQL then scans the entire repository to find unsanitized dataflow paths connecting these sources and sinks.
- Contextual Filtering (LLM): Because the LLM might guess too many sources/sinks, CodeQL will output some false positives. IRIS takes the code snippets along the detected paths and feeds them back into the LLM, asking it to reason about the context and classify the alert as a true vulnerability or a false positive.
Evaluation and the CWE-Bench-Java Dataset
To evaluate IRIS, the authors curated a brand new benchmark: CWE-Bench-Java. It contains 120 manually validated vulnerabilities across four common vulnerability classes (Path Traversal, OS Command Injection, Cross-Site Scripting, and Code Injection). Unlike existing datasets, every project in CWE-Bench-Java is real-world (averaging 300K lines of code), end-to-end compilable (a strict requirement for static analysis), and includes exact fix locations.
Key Insights and Results
- Massive Boost in Detection: IRIS paired with GPT-4 detected 55 out of 120 vulnerabilities—a 103.7% improvement over CodeQL, which only found 27.
- Fewer False Alarms: Despite finding more bugs, IRIS actually improved the average false discovery rate (FDR) by 5.21% compared to CodeQL, proving the LLM contextual filter works.
- Zero-Day Discoveries: When applied to the latest versions of 30 popular Java projects, IRIS discovered 4 previously unknown vulnerabilities that CodeQL completely missed.
- Over-approximation is a Feature: LLMs tend to be overly aggressive when guessing what an API does, labeling too many things as sinks. While this sounds bad, it perfectly complements static analysis, which is usually too rigid. The static analyzer connects the dots, and the final LLM contextual filter cleans up the mess.
- LLMs "Know" the Internet's APIs: Because LLMs are trained on massive amounts of GitHub data, they have an intuitive understanding of obscure third-party APIs that human security researchers haven't manually modeled yet.
Limitations and Future Work
While highly effective, IRIS still struggles with highly intricate vulnerabilities, such as OS Command Injections (CWE-78) that rely on complex "gadget chains," or dataflows that happen via side-effects (e.g., writing untrusted data to a file and reading it later). Static analysis fundamentally struggles to track these. Additionally, the system makes numerous calls to LLMs for specification inference and false-positive filtering, which can be computationally expensive and slow for massive repositories.
Future directions include exploring tighter, more iterative integrations between LLMs and static analysis engines, expanding the framework to languages beyond Java, and improving the formatting of the final vulnerability reports to better suit developer workflows.
Summary updated