Skip to main content
QUICK REVIEW

[论文解读] LLMs in Software Security: A Survey of Vulnerability Detection Techniques and Insights

Ze Sheng, Zhicheng Chen|ArXiv.org|Feb 10, 2025
Software Reliability and Analysis ResearchComputer Science被引用 3
一句话总结

对大型语言模型在软件漏洞检测中的应用进行全面综述,涵盖体系结构、基准、数据集、评估指标、技术与未来挑战。强调当前趋势、数据集及跨语言与代码库层面的检测差距。

ABSTRACT

Large Language Models (LLMs) are emerging as transformative tools for software vulnerability detection, addressing critical challenges in the security domain. Traditional methods, such as static and dynamic analysis, often falter due to inefficiencies, high false positive rates, and the growing complexity of modern software systems. By leveraging their ability to analyze code structures, identify patterns, and generate repair suggestions, LLMs, exemplified by models like GPT, BERT, and CodeBERT, present a novel and scalable approach to mitigating vulnerabilities. This paper provides a detailed survey of LLMs in vulnerability detection. It examines key aspects, including model architectures, application methods, target languages, fine-tuning strategies, datasets, and evaluation metrics. We also analyze the scope of current research problems, highlighting the strengths and weaknesses of existing approaches. Further, we address challenges such as cross-language vulnerability detection, multimodal data integration, and repository-level analysis. Based on these findings, we propose solutions for issues like dataset scalability, model interpretability, and applications in low-resource scenarios. Our contributions are threefold: (1) a systematic review of how LLMs are applied in vulnerability detection; (2) an analysis of shared patterns and differences across studies, with a unified framework for understanding the field; and (3) a summary of key challenges and future research directions. This work provides valuable insights for advancing LLM-based vulnerability detection. We also maintain and regularly update latest selected paper on https://github.com/OwenSanzas/LLM-For-Vulnerability-Detection

研究动机与目标

  • 评估用于漏洞检测的LLM体系结构及其为何适合安全任务。
  • 评估用于评估LLM基础漏洞检测的数据集、基准和指标。
  • 识别当前研究中的有效技术、提示策略与评估实践。
  • 突出挑战并提出推进LLM基础漏洞检测在现实世界情境中的方向性建议。

提出的方法

  • 对2019-2024年间发表的80余篇论文(58篇高度相关)进行系统性综述,聚焦LLM在漏洞检测中的应用。
  • 将LLM架构分为编码器-仅、编码器-解码器、解码器-仅三大类。
  • 分析函数级、文件级、提交级和代码库级等不同粒度的数据集与基准。
  • 将评估指标整理为分类、生成和效率等类别。
  • 在语言与情境间识别模式、最佳实践与差距。
  • 提出未来研究方向与资源需求。

实验结果

研究问题

  • RQ1RQ1:哪些LLMs已被应用于漏洞检测?
  • RQ2RQ2:设计了哪些基准、数据集和指标来评估漏洞检测?
  • RQ3RQ3:在LLM进行漏洞检测中使用了哪些技术?
  • RQ4RQ4:LLMs在检测漏洞时面临哪些挑战,以及潜在的解决方向?

主要发现

  • C/C++、Java和Solidity是主导目标语言;C/C++的与内存相关漏洞是主要关注点。
  • 解码器-仅模型(如GPT系列、CodeLlama)在微调研究中占比最大,而编码器-仅模型仍然常用于理解任务。
  • GPT-4和GPT-3.5在各项研究中使用最广,GPT-4在若干报告中显示出较强的性能。
  • 基准数据集覆盖函数级、文件级、提交级和代码库级等尺度,常用数据集包括BigVul、CVEfixes、Devign、Juliet和CWE-Bench-Java等。
  • 数据集在语言上存在不平衡(大约50-60%是C/C++,Java代表性不足),且缺乏面向真实世界情境的全面代码库级数据集。
  • 当前数据集往往范围较窄、存在数据泄露风险;需要更大规模、更加真实且覆盖代码库级的数据,以及更好的跨文件上下文建模。

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。