arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2503.17885cs.SEcs.AI
收藏

利用大语言模型推理实现零样本漏洞检测

Reasoning with LLMs for Zero-Shot Vulnerability Detection

University of North Carolina at Charlotte(北卡罗来纳大学夏洛特分校)

Arastoo Zibaeirad, Marco Vieira

AI总结:

针对现有大语言模型漏洞检测评估缺乏上下文鲁棒性的问题,提出多粒度零样本评估框架VulnSage及低噪数据集,验证结构化推理提示和代码专用模型可显著提升检测性能。

摘要:

在软件系统日益复杂且相互依存的时代,自动化软件漏洞检测(SVD)仍是一项关键挑战。尽管大语言模型(LLM)在代码分析领域已取得显著进展,但主流评估方法往往缺乏捕捉真实世界复杂性和跨组件交互所必需的上下文感知鲁棒性。为解决这些局限,我们提出VulnSage——一个综合性评估框架及配套数据集,该数据集从多个采用C/C++开发的大规模开源系统软件项目中整理而来。与以往数据集不同,它结合启发式噪声预过滤方法与基于LLM的推理,确保漏洞样本具有代表性且噪声极低。该框架支持跨函数、文件和函数间层级的多粒度分析,并采用四种不同的零样本提示策略:Baseline(基线)、Chain-of-Thought(思维链)、Think(思考)和Think & Verify(思考与验证)。通过本次评估我们发现,结构化推理提示能大幅提升LLM性能,其中Think & Verify将模糊响应占比从20.3%降至9.1%,同时提升了准确率。我们进一步证实,代码专用模型的表现始终优于通用模型,且不同漏洞类型下的性能差异显著,表明没有任何一种方法能在所有安全场景下普遍适用。数据集与代码链接:https://github.com/Erroristotle/VulnSage.git

英文摘要:

Automating software vulnerability detection (SVD) remains a critical challenge in an era of increasingly complex and interdependent software systems. Despite significant advances in Large Language Models (LLMs) for code analysis, prevailing evaluation methodologies often lack the \textbf{context-aware robustness} necessary to capture real-world intricacies and cross-component interactions. To address these limitations, we present \textbf{VulnSage}, a comprehensive evaluation framework and a dataset curated from diverse, large-scale open-source system software projects developed in C/C++. Unlike prior datasets, it leverages a heuristic noise pre-filtering approach combined with LLM-based reasoning to ensure a representative and minimally noisy spectrum of vulnerabilities. The framework supports multi-granular analysis across function, file, and inter-function levels and employs four diverse zero-shot prompt strategies: Baseline, Chain-of-Thought, Think, and Think & Verify. Through this evaluation, we uncover that structured reasoning prompts substantially improve LLM performance, with Think & Verify reducing ambiguous responses from 20.3% to 9.1% while increasing accuracy. We further demonstrate that code-specialized models consistently outperform general-purpose alternatives, with performance varying significantly across vulnerability types, revealing that no single approach universally excels across all security contexts. Link to dataset and codes: https://github.com/Erroristotle/VulnSage.git

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑