Abstract
Recent advancements in deep learning have led to the proliferation of function-level vulnerability detectors for Static Application Security Testing (SAST). However, these models are often trained on datasets that only label the functions requiring patches, ignoring the complex execution paths where vulnerabilities are actually triggered. This paper investigates the effectiveness of state-of-the-art (SOTA) detectors on inter-procedural vulnerabilities—bugs where the root cause and the exploit trigger reside in different functions. We introduce VulTrigger, a tool for tracing cross-function triggers, and InterPVD, the first dataset specifically designed for inter-procedural vulnerability analysis. Our findings reveal a significant performance gap: AI detectors are substantially less effective at identifying triggering functions than they are at identifying patched functions, highlighting a critical blind spot in current automated security analysis.
Introduction
Deep learning-based vulnerability detection has largely focused on function-level granularity. In this paradigm, a model analyzes a single function in isolation to determine if it is vulnerable. While effective for intra-procedural vulnerabilities—where the flaw and its manifestation occur within the same scope—this approach struggles with inter-procedural vulnerabilities.
In an inter-procedural scenario, the to-be-patched statement (the logic requiring a fix) is located in one function, while the vulnerability-triggering statement (the point of failure, such as a buffer overflow or null pointer dereference) is located in another. Because existing datasets primarily label the patched functions, current models are inadvertently trained to recognize "patch locations" rather than the underlying vulnerable behavior. This research aims to quantify this discrepancy and provide the tools necessary to bridge the gap.
Methodology: The VulTrigger Framework
To systematically analyze inter-procedural vulnerabilities, the authors developed VulTrigger, an automated static analysis tool designed to trace the path from a patch to its corresponding trigger. The framework operates in three primary stages:
- Critical Variable Identification: The tool parses patch files (diffs) to identify variables central to the fix, such as those involved in new bounds checks or nullity tests.
- Enhanced Program Slicing: VulTrigger generates program slices by tracing the data and control flow of these critical variables across function boundaries. The authors improved upon standard slicing techniques to better account for implicit returns and execution paths that persist after a patched function completes.
- Triggering Statement Identification: The tool utilizes a knowledge base of 19 trigger characteristics across 16 Common Weakness Enumerations (CWEs). It scans the generated slices to pinpoint the exact statement—such as a
memcpyor a sensitive arithmetic operation—that triggers the vulnerability.
InterPVD: A Novel Dataset
To facilitate this research, the authors curated InterPVD, a dataset comprising 769 C/C++ vulnerabilities sourced from 53 open-source projects. InterPVD is unique in that it explicitly labels:
- The specific patch statements.
- The specific triggering statements.
- The number of inter-procedural layers (the "distance" between patch and trigger).
- The sequence of function calls connecting the two.
This dataset provides a rigorous benchmark for evaluating how well detectors handle vulnerabilities that span multiple functions.
Key Insights and Results
The Prevalence of Inter-Procedural Bugs
The study found that inter-procedural vulnerabilities are common, representing 24.3% of the analyzed cases. On average, these vulnerabilities span 2.8 function layers. These are categorized into "caller types" (18.1%), where the patched function calls the triggering function, and "callee types" (6.2%), where the trigger occurs after the patched function returns to its caller.
VulTrigger vs. Traditional SAST
VulTrigger demonstrated superior precision in identifying triggering statements compared to traditional SAST tools. On the InterPVD dataset, VulTrigger achieved 69.8% accuracy, significantly outperforming tools like Checkmarx (12.7%) and Flawfinder (9.8%). Furthermore, while traditional tools often produce high volumes of false positives, VulTrigger narrowed the results down to approximately one statement per vulnerability for human review.
The AI Detector Blind Spot
The authors evaluated five SOTA deep learning detectors: VulBERTa, LineVul, Devign, ReVeal, and VulCNN. The results were telling:
- Performance Degradation: The F1 scores of these detectors dropped by an average of 18.7% when tasked with identifying the triggering function compared to the patched function.
- Complexity Sensitivity: Detectors were consistently less accurate at finding the patched functions of inter-procedural vulnerabilities than those of simpler, intra-procedural ones.
- Contextual Failure: Because these models are trained on patch-centric labels, they fail to learn the execution context that leads to a trigger. If a developer uses these tools, the model might flag the root cause but fail to identify where the actual exploit occurs, complicating the debugging and remediation process.
Conclusion and Future Work
The current generation of function-level vulnerability detectors suffers from a significant "patch-bias," making them less effective at identifying the triggers of complex, multi-function vulnerabilities. VulTrigger and the InterPVD dataset provide a path forward by enabling the identification and labeling of inter-procedural flows.
Future research should focus on moving beyond function-level analysis toward slice-level detection. By training models on high-quality program slices that capture the context flowing between functions, the security community can develop a new generation of AI tools capable of understanding and detecting the full lifecycle of a vulnerability, from root cause to trigger.
Summary updated