Skip to main content
QUICK REVIEW

[Paper Review] How Far Have We Gone in Vulnerability Detection Using Large Language Models

Zeyu Gao, Hao Wang|arXiv (Cornell University)|Nov 21, 2023
Software Engineering ResearchComputer Science7 citations
TL;DR

This paper introduces VulBench, a large vulnerability-detection benchmark, and evaluates 16 LLMs against SOTA DL models and static analyzers across CTF and real-world datasets, showing LLMs can outperform traditional methods in some scenarios but lag in complex real-world cases.

ABSTRACT

As software becomes increasingly complex and prone to vulnerabilities, automated vulnerability detection is critically important, yet challenging. Given the significant successes of large language models (LLMs) in various tasks, there is growing anticipation of their efficacy in vulnerability detection. However, a quantitative understanding of their potential in vulnerability detection is still missing. To bridge this gap, we introduce a comprehensive vulnerability benchmark VulBench. This benchmark aggregates high-quality data from a wide range of CTF (Capture-the-Flag) challenges and real-world applications, with annotations for each vulnerable function detailing the vulnerability type and its root cause. Through our experiments encompassing 16 LLMs and 6 state-of-the-art (SOTA) deep learning-based models and static analyzers, we find that several LLMs outperform traditional deep learning approaches in vulnerability detection, revealing an untapped potential in LLMs. This work contributes to the understanding and utilization of LLMs for enhanced software security.

Motivation & Objective

  • Motivate automated vulnerability detection amid increasing software complexity.
  • Create a high-quality, multi-source vulnerability dataset with clear vulnerability types and root causes.
  • Assess the performance of 16 LLMs against state-of-the-art deep learning models and static analyzers on vulnerability detection tasks.
  • Provide guidelines and baseline results to guide future research in LLM-assisted vulnerability detection.

Proposed method

  • Construct VulBench by aggregating CTF challenges, MAGMA, Devign, D2A, and Big-Vul datasets with expert human labeling.
  • Evaluate functions using binary classification (vulnerable vs not) and multi-class classification (vulnerability type).
  • Compare 16 LLMs with three deep-learning baselines and three static analyzers under consistent evaluation setups.
  • Use two-shot and five-shot prompting with a uniform output template to ensure parseable results across models.
  • Analyze given input contexts (full binary, single function, decompiled vs source) to study information provision effects.

Experimental results

Research questions

  • RQ1To what extent can LLMs detect vulnerabilities compared with traditional DL models and static analyzers?
  • RQ2How does the quality and type of input information affect LLM vulnerability detection performance?
  • RQ3How do LLMs perform on CTF/scenario-based vulnerabilities versus real-world CVE-derived vulnerabilities?
  • RQ4What are the limitations and biases of LLMs in vulnerability detection, and how can datasets and prompts be improved?
  • RQ5Can VulBench provide reliable, scalable evaluation for future LLM-based vulnerability research?

Key findings

  • LLMs, especially GPT-4, can outperform best baselines on CTF-style vulnerability detection in binary and multi-class tasks.
  • Open-access LLMs show scaling benefits but are limited by dataset quality and context length, with GPT-4 often leading results in simpler datasets.
  • In real-world datasets, all models, including LLMs, underperform and tend toward conservatism, with RLHF-tuned models showing bias toward certain vulnerability types.
  • Decompiled code limitations and closed-source context reduce LLM effectiveness, highlighting the value of richer context and integration with static analysis or fuzzing tools.
  • VulBench provides a curated, multi-source dataset with natural-language vulnerability descriptions to improve evaluation validity and comparability.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.