Most vulnerability detection studies focus on datasets of vulnerabilities in C/C++ code, offering limited language diversity. Thus, the effectiveness of deep learning methods, including large language models (LLMs), in detecting software vulnerabilities beyond these languages is still largely unexplored. In this paper, we evaluate the effectiveness of LLMs in detecting and classifying Common Weakness Enumerations (CWE) using different prompt and role strategies. Our experimental study targets six state-of-the-art pre-trained LLMs (GPT-3.5- Turbo, GPT-4 Turbo, GPT-4o, CodeLLama-7B, CodeLLama- 13B, and Gemini 1.5 Pro) and five programming languages: Python, C, C++, Java, and JavaScript. We compiled a multi-language vulnerability dataset from different sources, to ensure representativeness. Our results showed that GPT-4o achieves the highest vulnerability detection and CWE classification scores using a few-shot setting. Aside from the quantitative results of our study, we developed a library called CODEGUARDIAN integrated with VSCode which enables developers to perform LLM-assisted real-time vulnerability analysis in real-world security scenarios. We have evaluated CODEGUARDIAN with a user study involving 22 developers from the industry. Our study showed that, by using CODEGUARDIAN, developers are more accurate and faster at detecting vulnerabilities.


翻译:多数漏洞检测研究集中于C/C++代码漏洞数据集,语言多样性有限。因此,深度学习(包括大语言模型)在检测这些语言之外的软件漏洞方面的有效性仍很大程度上未被探索。本文通过不同提示与角色策略,评估了大语言模型在检测与分类通用缺陷枚举(CWE)方面的有效性。我们的实验研究针对六种最先进的预训练大语言模型(GPT-3.5-Turbo、GPT-4 Turbo、GPT-4o、CodeLLama-7B、CodeLLama-13B和Gemini 1.5 Pro)以及五种编程语言:Python、C、C++、Java和JavaScript。我们从不同来源汇编了一个多语言漏洞数据集,以确保代表性。结果表明,在少样本设置下,GPT-4o取得了最高的漏洞检测与CWE分类分数。除定量研究结果外,我们还开发了一个名为CODEGUARDIAN的库,该库与VSCode集成,使开发者能够在实际安全场景中执行大语言模型辅助的实时漏洞分析。我们通过一项涉及22名行业开发者的用户研究对CODEGUARDIAN进行了评估。研究表明,使用CODEGUARDIAN后,开发者在漏洞检测方面更准确、更快速。

0
下载
关闭预览

相关内容

大语言模型在序列推荐中的应用
专知会员服务
19+阅读 · 2024年11月12日
大语言模型评估技术研究进展
专知会员服务
48+阅读 · 2024年7月9日
大型语言模型网络安全综述
专知会员服务
67+阅读 · 2024年5月12日
多语言大型语言模型:资源、分类和前沿综述
专知会员服务
53+阅读 · 2024年4月9日
大型语言模型在预测和异常检测中的应用综述
专知会员服务
70+阅读 · 2024年2月19日
大语言模型安全现状与挑战
专知会员服务
87+阅读 · 2024年1月14日
「知识增强预训练语言模型」最新研究综述
专知
18+阅读 · 2022年11月18日
自然语言处理中的语言模型预训练方法
PaperWeekly
14+阅读 · 2018年10月21日
NLP通用模型诞生?一个模型搞定十大自然语言常见任务
人工智能头条
10+阅读 · 2018年6月29日
推荐|机器学习中的模型评价、模型选择和算法选择!
全球人工智能
10+阅读 · 2018年2月5日
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
13+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
相关基金
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
18+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
13+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员