arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2303.09384cs.SEcs.IRcs.LG
收藏

LLMSecEval:一个用于安全评估的自然语言数据集

LLMSecEval: A Dataset of Natural Language Prompts for Security Evaluations

Institute of Software Security(软件安全研究所);Hamburg University of Technology(汉堡工业大学)

Catherine Tony, Markus Mutas, Nicolás E. Díaz Ferreyra, Riccardo Scandariato

摘要:

像Codex这样的大语言模型(LLM)是执行代码完成和代码生成任务的强大工具,因为它们是在来自公开源的数十亿行代码上训练的。此外,这些模型能够通过从公共GitHub存储库学习语言和编程实践,从自然语言(NL)描述中生成代码片段。尽管LLM承诺轻松地部署软件应用程序的NL驱动,但它们生成的代码的安全性尚未得到广泛的调查或记录。在这项工作中,我们提出了LLMSecEval,一个包含150个NL提示的数据集,可以用来评估这些模型的安全性能。这些提示是对MITRE的前25个常见弱点枚举(CWE)排名中列出的各种安全漏洞的代码片段的NL描述。我们数据集中的每个提示都带有一个安全的实现示例,以便于与LLM生成的代码进行比较评估。作为一个实际的应用程序,我们展示了如何LLMSecEval可以用于评估自动生成的NL描述的片段的安全性。

英文摘要:

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.

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

↑