代码变更意图、开发制品与历史漏洞:结合三者利用LLM进行漏洞修复检测
Code Change Intention, Development Artifact and History Vulnerability: Putting Them Together for Vulnerability Fix Detection by LLM
AI总结:
针对现有漏洞修复检测方法忽略开发制品上下文及缺乏解释的问题,提出LLM4VFD框架,结合代码变更意图、开发制品与历史漏洞上下文,利用LLM与思维链推理提升检测准确率,并提供可解释分析,较现有方法提升68.1%-145.4%。
摘要:
在开源软件中检测漏洞修复提交对于维护软件安全至关重要。为帮助开源软件(OSS)识别漏洞修复提交,已开发了多种自动化方法。然而,现有的方法如VulFixMiner和CoLeFunDa仅关注代码变更,忽略了来自开发制品的重要上下文。像Vulcurator这样集成了问题报告的工具,未能利用不同开发制品(例如拉取请求和历史漏洞修复)之间的语义关联。此外,它们会遗漏混合提交中的漏洞修复且缺乏解释,限制了实际应用。因此,为了解决这些局限性,我们提出了LLM4VFD,这是一个利用大型语言模型(LLMs)并结合思维链推理和上下文学习来提高漏洞修复检测准确性的新型框架。LLM4VFD包含三个组件:(1)代码变更意图,使用思维链推理分析提交摘要、目的和影响;(2)开发制品,结合来自相关问题报告和拉取请求的上下文;(3)历史漏洞,检索过去相似的漏洞修复以丰富上下文。更重要的是,在预测的基础上,LLM4VFD还提供了详细的分析和解释,以帮助安全专家理解决策背后的依据。我们使用新收集的数据集BigVulFixes,对LLM4VFD与最先进的技术(包括基于预训练语言模型的方法和原始LLMs)进行了对比评估。实验结果表明,LLM4VFD显著优于表现最佳的现有方法,提升幅度达68.1%--145.4%。此外,我们对安全专家进行了用户研究,表明LLM4VFD生成的分析提高了漏洞修复识别的效率。
英文摘要:
Detecting vulnerability fix commits in open-source software is crucial for maintaining software security. To help OSS identify vulnerability fix commits, several automated approaches are developed. However, existing approaches like VulFixMiner and CoLeFunDa, focus solely on code changes, neglecting essential context from development artifacts. Tools like Vulcurator, which integrates issue reports, fail to leverage semantic associations between different development artifacts (e.g., pull requests and history vulnerability fixes). Moreover, they miss vulnerability fixes in tangled commits and lack explanations, limiting practical use. Hence to address those limitations, we propose LLM4VFD, a novel framework that leverages Large Language Models (LLMs) enhanced with Chain-of-Thought reasoning and In-Context Learning to improve the accuracy of vulnerability fix detection. LLM4VFD comprises three components: (1) Code Change Intention, which analyzes commit summaries, purposes, and implications using Chain-of-Thought reasoning; (2) Development Artifact, which incorporates context from related issue reports and pull requests; (3) Historical Vulnerability, which retrieves similar past vulnerability fixes to enrich context. More importantly, on top of the prediction, LLM4VFD also provides a detailed analysis and explanation to help security experts understand the rationale behind the decision. We evaluated LLM4VFD against state-of-the-art techniques, including Pre-trained Language Model-based approaches and vanilla LLMs, using a newly collected dataset, BigVulFixes. Experimental results demonstrate that LLM4VFD significantly outperforms the best-performed existing approach by 68.1%--145.4%. Furthermore, We conducted a user study with security experts, showing that the analysis generated by LLM4VFD improves the efficiency of vulnerability fix identification.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。