arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2604.10767cs.SE
收藏

VulWeaver: 修补断裂语义以实现基于事实的漏洞检测

VulWeaver: Weaving Broken Semantics for Grounded Vulnerability Detection

Huawei Technologies Co., Ltd.(华为技术有限公司)

Yiheng Cao, Yihao Chen, Xin Hu, Bihuan Chen, Jiayi Deng, Zhuotong Zhou, Susheng Wu, Yiheng Huang, Xueying Du, Xingman Chen, Miaohua Li, Xin Peng

AI总结:

VulWeaver通过整合确定性规则与LLM语义推理构建增强依赖图,提取完整漏洞上下文,利用元提示和专家指南提升LLM推理能力,实验显示其在PrimeVul4J数据集上F1得分达0.75,优于现有方法。

摘要:

检测源代码中的漏洞仍至关重要且具有挑战性,因为传统静态分析工具构建的程序表示不准确,而现有基于LLM的方法常遗漏关键漏洞上下文且缺乏基于事实的推理。为缓解这些挑战,我们引入了VulWeaver,一种新的基于LLM的方法,将断裂的程序语义编织成准确的表示,并提取完整的漏洞上下文以实现基于事实的漏洞检测。具体而言,VulWeaver首先通过整合确定性规则与基于LLM的语义推理构建增强的统一依赖图(UDG),以解决静态分析的不准确性。然后通过结合显式上下文(来自程序切片)与隐式上下文(包括使用、定义和声明信息)提取完整的漏洞上下文。最后,VulWeaver利用元提示和特定漏洞类型的专家指南引导LLM进行系统推理,并通过多数投票聚合以提高鲁棒性。在PrimeVul4J数据集上的广泛实验表明,VulWeaver在F1得分上达到0.75,分别比最先进的学习-based、LLM-based和agent-based基线方法高出23%、15%和60%。VulWeaver还检测了9个真实世界Java项目中的26个真实漏洞,其中15个已由开发人员确认,5个已分配CVE标识符。在工业部署中,VulWeaver在内部仓库中发现了40个确认的漏洞。

英文摘要:

Detecting vulnerabilities in source code remains critical yet challenging, as conventional static analysis tools construct inaccurate program representations, while existing LLM-based approaches often miss essential vulnerability context and lack grounded reasoning. In this paper, we introduce VulWeaver, a novel LLM-based approach that weaves broken program semantics into accurate representations and extracts holistic vulnerability context for grounded vulnerability detection. VulWeaver first constructs an enhanced unified dependency graph (UDG) by integrating deterministic rules with LLM-based semantic inference to address static analysis inaccuracies. It then extracts holistic vulnerability context by combining explicit contexts from program slicing with implicit contexts, including usage, definition, and declaration information. Finally, VulWeaver employs meta-prompting with vulnerability type specific expert guidelines to steer LLMs through systematic reasoning, aggregated via majority voting for robustness. Extensive experiments on PrimeVul4J dataset show that VulWeaver achieves a precision of 0.82, recall of 0.71, and F1-score of 0.76, outperforming state-of-the-art learning-based, LLM-based, and agent-based baselines by 25%, 17%, and 21% in F1-score, respectively. Notably, VulWeaver attains a VP-S score of 0.58, 164% higher than the best baseline, confirming its strong discriminative power

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

↑