Large Language Models (LLMs) like Codex are powerful tools for performing code completion and code generation tasks as they are trained on billions of lines of code from publicly available sources. Moreover, these models are capable of generating code snippets from Natural Language (NL) descriptions by learning languages and programming practices from public GitHub repositories. Although LLMs promise an effortless NL-driven deployment of software applications, the security of the code they generate has not been extensively investigated nor documented. In this work, we present LLMSecEval, a dataset containing 150 NL prompts that can be leveraged for assessing the security performance of such models. Such prompts are NL descriptions of code snippets prone to various security vulnerabilities listed in MITRE's Top 25 Common Weakness Enumeration (CWE) ranking. Each prompt in our dataset comes with a secure implementation example to facilitate comparative evaluations against code produced by LLMs. As a practical application, we show how LLMSecEval can be used for evaluating the security of snippets automatically generated from NL descriptions.


翻译:大型语言模型(LLMs)如Codex,因从公开来源的数万亿行代码中训练而成,成为执行代码补全与代码生成任务的强大工具。此外,这些模型通过从公共GitHub仓库学习语言与编程实践,能够根据自然语言描述生成代码片段。尽管LLMs承诺基于自然语言驱动的软件应用开发将变得简便,但其生成代码的安全性尚未得到广泛研究或记录。本文提出LLMSecEval数据集,包含150个自然语言提示,可用于评估此类模型的安全性能。这些提示是易受MITRE Top 25通用弱点枚举排名中各类安全漏洞影响的代码片段的自然语言描述。数据集中每个提示均附有安全实现示例,以便与LLMs生成的代码进行对比评估。作为实际应用,我们展示了如何利用LLMSecEval评估从自然语言描述自动生成的代码片段的安全性。

0
下载
关闭预览

相关内容

《用于代码弱点识别的 LLVM 中间表示》CMU
专知会员服务
14+阅读 · 2022年12月12日
【硬核书】树与网络上的概率,716页pdf
专知会员服务
77+阅读 · 2021年12月8日
FlowQA: Grasping Flow in History for Conversational Machine Comprehension
专知会员服务
34+阅读 · 2019年10月18日
强化学习最新教程,17页pdf
专知会员服务
182+阅读 · 2019年10月11日
VCIP 2022 Call for Demos
CCF多媒体专委会
1+阅读 · 2022年6月6日
Hierarchically Structured Meta-learning
CreateAMind
27+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
LibRec 精选:推荐系统的常用数据集
LibRec智能推荐
17+阅读 · 2019年2月15日
【泡泡一分钟】用于评估视觉惯性里程计的TUM VI数据集
泡泡机器人SLAM
11+阅读 · 2019年1月4日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
【推荐】图像分类必读开创性论文汇总
机器学习研究会
14+阅读 · 2017年8月15日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
VIP会员
最新内容
“蛛网”行动一周年:远程无人机战争
专知会员服务
0+阅读 · 31分钟前
加沙、乌克兰和伊朗冲突:人工智能如何改变冲突
【剑桥博士论文】智能体-环境协同优化
专知会员服务
5+阅读 · 6月9日
为初级军官战术训练设计生成式人工智能平台
专知会员服务
7+阅读 · 6月9日
《美军条令:作战伤员后送保障》
专知会员服务
5+阅读 · 6月9日
《美空军条令出版物 4-0,维持》
专知会员服务
5+阅读 · 6月9日
相关VIP内容
《用于代码弱点识别的 LLVM 中间表示》CMU
专知会员服务
14+阅读 · 2022年12月12日
【硬核书】树与网络上的概率,716页pdf
专知会员服务
77+阅读 · 2021年12月8日
FlowQA: Grasping Flow in History for Conversational Machine Comprehension
专知会员服务
34+阅读 · 2019年10月18日
强化学习最新教程,17页pdf
专知会员服务
182+阅读 · 2019年10月11日
相关资讯
VCIP 2022 Call for Demos
CCF多媒体专委会
1+阅读 · 2022年6月6日
Hierarchically Structured Meta-learning
CreateAMind
27+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
LibRec 精选:推荐系统的常用数据集
LibRec智能推荐
17+阅读 · 2019年2月15日
【泡泡一分钟】用于评估视觉惯性里程计的TUM VI数据集
泡泡机器人SLAM
11+阅读 · 2019年1月4日
Unsupervised Learning via Meta-Learning
CreateAMind
44+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
【推荐】图像分类必读开创性论文汇总
机器学习研究会
14+阅读 · 2017年8月15日
相关基金
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
1+阅读 · 2013年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2012年12月31日
国家自然科学基金
0+阅读 · 2011年12月31日
国家自然科学基金
0+阅读 · 2009年12月31日
Top
微信扫码咨询专知VIP会员