VulDeeLocator: A Deep Learning-Based Fine-Grained Vulnerability Detector

Zhen Li, Deqing Zou, Shouhuai Xu, Zhaoxuan Chen, Yawei Zhu, Hai Jin

Introduction

Software vulnerabilities pose significant security risks, necessitating effective automated detection tools. While deep learning has shown promise in this domain, existing detectors often suffer from two primary limitations: inadequate detection capability due to the use of raw source code, and inadequate locating precision, which results in coarse-grained findings that are difficult for developers to action.

VulDeeLocator addresses these challenges by utilizing compiler intermediate code (LLVM IR) to capture rich program semantics and a specialized neural network architecture to pinpoint vulnerabilities at the statement level. This approach achieves a 4.2x improvement in locating precision over previous state-of-the-art methods.

Methodology

The core innovation of VulDeeLocator lies in its two-pronged approach: the use of intermediate representation and a granularity-refining neural network.

The VulDeeLocator Pipeline

The system follows a structured five-step process to move from raw input to localized vulnerability reports.

The overall workflow of VulDeeLocator, showing the progression from source code to fine-grained vulnerability detection.
  1. Extraction of sSyVCs: Identifying source code-based vulnerability candidates (sSyVCs) based on syntax characteristics. These are essentially program slices related to potential flaws.
  2. Generation of iSeVCs: Transforming these candidates into intermediate code-based semantic vulnerability candidates (iSeVCs) using LLVM IR.
  3. Labeling: Annotating iSeVCs from training programs for supervised learning.
  4. Model Training: Training the BRNN-vdl (Bidirectional Recurrent Neural Network for vulnerability detection and locating).
  5. Detection and Localization: Applying the trained model to target programs to identify and locate vulnerabilities.

Intermediate Code and Granularity Refinement

Unlike traditional detectors that analyze raw C source code, VulDeeLocator compiles programs into LLVM Intermediate Representation (IR). LLVM IR, particularly in Static Single Assignment (SSA) form, explicitly defines control flows and variable define-use relationships. This allows the model to account for complex semantic structures, such as macros and cross-file dependencies.

An example of a source code-based vulnerability candidate (sSyVC) extracted from a program, illustrating the slicing process.

To achieve fine-grained localization, the authors designed the BRNN-vdl architecture. By incorporating specialized pooling layers (multiply, $\kappa$-max, and average pooling), the network acts as an attention mechanism, focusing on the most critical tokens within a code slice to identify the exact vulnerable statements.

Experimental Results

The authors evaluated VulDeeLocator using a large-scale dataset of 157,692 intermediate code vulnerability candidates derived from NVD and SARD.

  • Superior Detection: VulDeeLocator achieved a 9.8% higher F1-measure compared to the previous state-of-the-art detector, SySeVR, while significantly reducing both false-positive and false-negative rates.
  • Precision Leap: The tool demonstrated a massive improvement in locating precision. On average, VulDeeLocator narrows vulnerabilities down to approximately 3 lines of code, compared to ~56 lines typically flagged by previous methods.
  • Real-World Validation: In tests on real-world software such as FFmpeg and Wireshark, VulDeeLocator identified 18 confirmed vulnerabilities, including two that had been "silently patched" without being reported to the National Vulnerability Database (NVD).

Conclusion

VulDeeLocator represents a significant advancement in automated vulnerability detection. By leveraging the semantic clarity of compiler intermediate code and a custom architecture for fine-grained localization, it provides developers with highly accurate and actionable security insights. Future research will aim to extend this framework to other programming languages and enhance the interpretability of the deep learning models.

Summary updated

BibTeX
@article{li2020vuldeelocator,
  author = {Zhen Li and Deqing Zou and Shouhuai Xu and Zhaoxuan Chen and Yawei Zhu and Hai Jin},
  title = {{VulDeeLocator: A Deep Learning-Based Fine-Grained Vulnerability Detector}},
  journal = {IEEE Trans. Dependable Secur. Comput.},
  year = {2020},
  doi = {10.1109/tdsc.2021.3076142},
}
Figure