LLMSecEval: A Dataset of Natural Language Prompts for Security Evaluations

Catherine Tony, Markus Mutas, Nicolás E. Díaz Ferreyra, Riccardo Scandariato
3/16/2023
cs.SEcs.IRcs.LG

No official code found. Best implementation: tuhh-softsec/LLMSecEval (59 stars, last commit 2024-10-04).

Abstract

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.

View on arXivView PDF

Code Implementations(1)

597HTML, SCSSJan 2, 20232 years ago

Similar Papers

Cite this paper

@article{tony2023llmseceval,
  title  = {LLMSecEval: A Dataset of Natural Language Prompts for Security Evaluations},
  author = {Catherine Tony and Markus Mutas and Nicolás E. Díaz Ferreyra and Riccardo Scandariato},
  year   = {2023},
  eprint = {2303.09384},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2303.09384v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2303.09384.svg)](https://codeofpaper.com/paper/2303.09384)

Discussion