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

在代码漏洞分析中使用LLMs:概念验证

LLMs in Code Vulnerability Analysis: A Proof of Concept

Ohio University(俄亥俄大学);University of Cincinnati(辛辛那提大学);University of Tennessee(田纳西大学)

Shaznin Sultana, Sadia Afreen, Nasir U. Eisty

AI总结:

本文探讨利用LLMs在代码漏洞分析中的应用,通过微调和提示方法评估模型性能,发现代码专用模型在复杂任务中表现优异,但现有指标不足以衡量修复质量。

摘要:

背景:传统的软件安全分析方法难以跟上现代代码库规模和复杂性的步伐,需要智能自动化来更高效准确地检测、评估和修复漏洞。目标:本文探讨将代码特定和通用的大型语言模型(LLMs)整合到自动化关键软件安全任务中,如识别漏洞、预测严重性和访问复杂性以及生成修复方案,作为概念验证。方法:我们评估了五对最近的LLMs,包括代码专用和通用的开源模型,在两个认可的C/C++漏洞数据集,即Big-Vul和Vul-Repair上。此外,我们还比较了微调和提示方法。结果:结果表明,微调在所有任务和模型上均优于零样本和少样本方法。值得注意的是,在复杂任务中,代码专用模型在零样本和少样本设置中表现优异,而通用模型几乎同样有效。CodeBLEU、CodeBERTScore、BLEU和ChrF之间的差异突显了当前指标在衡量修复质量方面的不足。结论:本研究通过探讨先进LLMs在改进漏洞分析和修复方面的潜力,为软件安全社区做出了贡献。

英文摘要:

Context: Traditional software security analysis methods struggle to keep pace with the scale and complexity of modern codebases, requiring intelligent automation to detect, assess, and remediate vulnerabilities more efficiently and accurately. Objective: This paper explores the incorporation of code-specific and general-purpose Large Language Models (LLMs) to automate critical software security tasks, such as identifying vulnerabilities, predicting severity and access complexity, and generating fixes as a proof of concept. Method: We evaluate five pairs of recent LLMs, including both code-based and general-purpose open-source models, on two recognized C/C++ vulnerability datasets, namely Big-Vul and Vul-Repair. Additionally, we compare fine-tuning and prompt-based approaches. Results: The results show that fine-tuning uniformly outperforms both zero-shot and few-shot approaches across all tasks and models. Notably, code-specialized models excel in zero-shot and few-shot settings on complex tasks, while general-purpose models remain nearly as effective. Discrepancies among CodeBLEU, CodeBERTScore, BLEU, and ChrF highlight the inadequacy of current metrics for measuring repair quality. Conclusions: This study contributes to the software security community by investigating the potential of advanced LLMs to improve vulnerability analysis and remediation.

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

↑