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是执行代码补全和代码生成任务的强大工具,因为它们训练于来自公开可用资源的数十亿行代码。此外,这些模型可以从自然语言(NL)描述生成代码片段,通过学习公共GitHub存储库中的语言和编程惯例。虽然LLMs承诺轻松的基于NL的软件应用部署,但却很少有关于它们生成的代码安全性的广泛调查和文档。在这项工作中,我们提供了LLMSecEval数据集,其中包含150个NL提示,可用于评估此类模型的安全性能。这些提示是列表在MITRE的Top 25常见弱点枚举(CWE)排名中的容易受到各种安全漏洞的代码片段的NL描述。我们数据集中的每个提示都配有一个安全实现示例,以便与LLMs生成的代码进行比较评估。作为一个实际应用,我们展示了LLMSecEval如何被用于评估从NL描述自动生成的代码片段的安全性。

0
下载
关闭预览

相关内容

《用于代码弱点识别的 LLVM 中间表示》CMU
专知会员服务
13+阅读 · 2022年12月12日
【硬核书】树与网络上的概率,716页pdf
专知会员服务
70+阅读 · 2021年12月8日
FlowQA: Grasping Flow in History for Conversational Machine Comprehension
专知会员服务
24+阅读 · 2019年10月18日
强化学习最新教程,17页pdf
专知会员服务
168+阅读 · 2019年10月11日
VCIP 2022 Call for Demos
CCF多媒体专委会
1+阅读 · 2022年6月6日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
26+阅读 · 2019年5月18日
LibRec 精选:推荐系统的常用数据集
LibRec智能推荐
17+阅读 · 2019年2月15日
【泡泡一分钟】用于评估视觉惯性里程计的TUM VI数据集
泡泡机器人SLAM
11+阅读 · 2019年1月4日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 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会员
相关VIP内容
《用于代码弱点识别的 LLVM 中间表示》CMU
专知会员服务
13+阅读 · 2022年12月12日
【硬核书】树与网络上的概率,716页pdf
专知会员服务
70+阅读 · 2021年12月8日
FlowQA: Grasping Flow in History for Conversational Machine Comprehension
专知会员服务
24+阅读 · 2019年10月18日
强化学习最新教程,17页pdf
专知会员服务
168+阅读 · 2019年10月11日
相关资讯
VCIP 2022 Call for Demos
CCF多媒体专委会
1+阅读 · 2022年6月6日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Transferring Knowledge across Learning Processes
CreateAMind
26+阅读 · 2019年5月18日
LibRec 精选:推荐系统的常用数据集
LibRec智能推荐
17+阅读 · 2019年2月15日
【泡泡一分钟】用于评估视觉惯性里程计的TUM VI数据集
泡泡机器人SLAM
11+阅读 · 2019年1月4日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 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会员