NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

VulDetectBench: Evaluating the Deep Capability of Vulnerability Detection with Large Language Models

Yu Liu, Lang Gao, Mingxin Yang, Yu Xie, Ping Chen, Xiaojin Zhang, Wei ChenarXiv 2024 · DOI

Introduction

While Large Language Models (LLMs) have demonstrated remarkable proficiency in code generation and summarization, their utility as reliable security auditors remains an open question. Most existing evaluations focus on a simple binary classification: "Is this code vulnerable?" However, for security professionals, a simple "Yes" without context is insufficient. To be truly effective, a tool must identify the specific type of vulnerability (CWE), the key variables involved, the exact line where the flaw originates (root cause), and the line where the program actually crashes or leaks (trigger point).

Researchers have introduced VulDetectBench, a sophisticated new benchmark designed to test whether LLMs actually "understand" software vulnerabilities or are merely recognizing patterns. This paper addresses the lack of a comprehensive, multi-layered benchmark that tests these granular, "deep" capabilities across both open-source and proprietary models.

The VulDetectBench Framework

The authors developed a hierarchy of five tasks with increasing difficulty to map the boundaries of LLM capability:

  1. Vulnerability Existence Detection: A binary classification (Yes/No).
  2. CWE Type Inference: Identifying the specific Common Weakness Enumeration category from five choices.
  3. Key Objects & Functions Identification: Extracting the specific data structures or function calls that lead to the flaw.
  4. Root Cause Location: Identifying the specific line of code where the vulnerability is introduced.
  5. Trigger Point Location: Identifying the line where the vulnerability is actually manifested or exploited.
The VulDetectBench pipeline, illustrating the transition from vulnerable code collection to multi-task evaluation.

Methodology and Datasets

The benchmark is built from a high-quality mix of sources to ensure robustness and accuracy. This includes real-world projects from nine major open-source repositories (e.g., OpenSSL, Wireshark, FFmpeg, and the Linux kernel), synthetic data from the Juliet C/C++ dataset (SARD), and refined versions of existing sets like Big-Vul and Devign. Rigorous filtering was applied to ensure 100% labeling accuracy, particularly for "no vulnerability" cases.

The final benchmark includes 1,000 entries for general detection and a subset of 100 highly detailed, manually verified cases for the difficult localization tasks. The evaluation involved 17 different LLMs, ranging from 6B to 70B parameters, using metrics such as F1-scores for classification and Union Recall Scores (URS) for line-level localization.

Key Insights and Results

The "Illusion of Understanding"

One of the most striking findings is that models often achieve over 80% accuracy in identifying and naming a vulnerability (Tasks 1 & 2) but fail significantly at locating it (Tasks 4 & 5). This suggests that LLMs may be relying on high-level linguistic cues rather than a deep semantic understanding of program execution.

Radar chart comparing the performance of various LLMs across the five benchmark tasks, highlighting the sharp drop-off in localization capabilities.

The Localization Gap

Even the highest-performing models, such as GPT-4, saw performance plummet from approximately 93% in type inference to roughly 24% in root cause location. For security researchers, this indicates that LLMs are currently better "smoke detectors" than "firefighters." While they can alert a human to a potential issue, they struggle to provide the precise location needed for remediation.

Model Performance Highlights

  • Top Performers: Ernie 4.0 achieved the highest accuracy for existence detection (85.01%), while GPT-4 dominated CWE type inference (92.96%).
  • Open-Source Leader: Mixtral-8x22B emerged as the strongest open-source contender, particularly in identifying key objects and functions.
  • Fine-tuning Potential: The researchers found that fine-tuning a model (like Llama-3-8B) specifically on localization tasks significantly boosted its performance (from ~1% to ~39% on Task 4), suggesting that the underlying knowledge exists but requires better instruction-following for precision.

Conclusion and Future Work

VulDetectBench reveals that while LLMs show promise, they are not yet ready for autonomous professional use in security auditing. Traditional static analysis tools like Flawfinder, while faster, produce excessive false positives and lack the nuanced context LLMs can theoretically offer.

Future work aims to expand the benchmark to include memory-safe languages like Java or Python and to investigate whether models are "remembering" vulnerabilities from training data rather than reasoning through them. For now, LLMs serve best as auxiliary tools, assisting human auditors rather than replacing them.

Summary updated

BibTeX
@misc{liu2024vuldetectbench,
  author = {Yu Liu and Lang Gao and Mingxin Yang and Yu Xie and Ping Chen and Xiaojin Zhang and Wei Chen},
  title = {{VulDetectBench: Evaluating the Deep Capability of Vulnerability Detection with Large Language Models}},
  year = {2024},
  eprint = {2406.07595},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2406.07595},
}
Figure