[论文解读] Comparison of Static Application Security Testing Tools and Large Language Models for Repo-level Vulnerability Detection
本研究对比了15种SAST工具和12种大型语言模型(LLMs)在Java、C和Python语言中的项目级漏洞检测表现。SAST工具虽然检测率较低但误报率较少,而LLMs实现了90%至100%的检测率但误报率较高;通过融合两者可减少各自局限性,从而提升整体性能。
Software vulnerabilities pose significant security challenges and potential risks to society, necessitating extensive efforts in automated vulnerability detection. There are two popular lines of work to address automated vulnerability detection. On one hand, Static Application Security Testing (SAST) is usually utilized to scan source code for security vulnerabilities, especially in industries. On the other hand, deep learning (DL)-based methods, especially since the introduction of large language models (LLMs), have demonstrated their potential in software vulnerability detection. However, there is no comparative study between SAST tools and LLMs, aiming to determine their effectiveness in vulnerability detection, understand the pros and cons of both SAST and LLMs, and explore the potential combination of these two families of approaches. In this paper, we compared 15 diverse SAST tools with 12 popular or state-of-the-art open-source LLMs in detecting software vulnerabilities from repositories of three popular programming languages: Java, C, and Python. The experimental results showed that SAST tools obtain low vulnerability detection rates with relatively low false positives, while LLMs can detect up 90\% to 100\% of vulnerabilities but suffer from high false positives. By further ensembling the SAST tools and LLMs, the drawbacks of both SAST tools and LLMs can be mitigated to some extent. Our analysis sheds light on both the current progress and future directions for software vulnerability detection.
研究动机与目标
- 为解决SAST工具与大型语言模型(LLMs)在项目级漏洞检测方面缺乏对比研究的问题。
- 提出一种新颖的项目级漏洞检测任务,适用于SAST工具与LLMs。
- 创建并整理了三个新数据集,分别包含Java、C和Python语言的完整漏洞项目源代码。
- 开发一个统一的评估框架,支持多种LLMs及适应性技术,用于项目级漏洞检测。
- 在多种编程语言的真实环境中,实证比较SAST工具与LLMs在有效性、优势与局限性方面的表现。
提出的方法
- 提出一种新的项目级漏洞检测任务,即模型需识别整个项目中的漏洞,而非单个函数。
- 整理了三个新数据集——VulnRepo-Java、VulnRepo-C和VulnRepo-Python,包含完整漏洞项目源代码,并对其中的漏洞进行标注。
- 使用标准扫描配置,在所有三种编程语言中评估了15种不同的SAST工具。
- 使用多种提示策略(零样本、少样本、思维链)及微调技术,评估了12个开源LLMs在项目级检测任务中的表现。
- 应用集成方法,结合SAST工具与LLMs的预测结果,以缓解各自的弱点。
- 使用标准指标(如检测率、误报率、F1值)比较不同工具与模型的性能表现。
实验结果
研究问题
- RQ1在Java、C和Python语言中,SAST工具与LLMs在项目级漏洞检测方面的表现如何比较?
- RQ2在真实项目中,SAST工具与LLMs的漏洞检测率和误报率分别是多少?
- RQ3通过集成方法结合SAST工具与LLMs,能否提升整体漏洞检测性能?
- RQ4不同LLM架构与提示策略对项目级漏洞检测性能有何影响?
- RQ5在真实世界、多语言环境下,SAST工具与LLMs的关键优势与局限性分别是什么?
主要发现
- SAST工具检测率较低,但误报率低,表明其具有高精确率但低召回率。
- LLMs在所有三种编程语言中均实现了90%至100%的检测率,表现出高召回率,但误报率较高。
- SAST工具与LLMs的集成方法在保持高检测率的同时降低了误报率,从而在F1值上优于单一方法。
- LLMs的性能显著受提示策略影响,其中思维链提示策略的表现优于零样本或少样本提示策略。
- 本研究首次对Python语言的SAST工具进行漏洞检测评估,揭示了该语言中的独特挑战。
- 整理的数据集——VulnRepo-Java、VulnRepo-C和VulnRepo-Python——为未来项目级漏洞检测研究提供了新的基准。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。