LLMSecEval: A Dataset of Natural Language Prompts for Security Evaluations
Preprint
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.Keywords
All Related Versions
This publication has 9 references indexed in Scilit:
- Correlating Automated and Human Evaluation of Code Documentation Generation QualityACM Transactions on Software Engineering and Methodology, 2022
- A systematic evaluation of large language models of code2022
- Asleep at the Keyboard? Assessing the Security of GitHub Copilot’s Code Contributions2022
- Pre-trained models: Past, present and futureAI Open, 2021
- Java Cryptography Uses in the Wild2020
- A Manually-Curated Dataset of Fixes to Vulnerabilities of Open-Source Software2019
- A Dataset of Parametric Cryptographic Misuses2019
- Interrater reliability: the kappa statisticBiochemia Medica, 2012
- The Equivalence of Weighted Kappa and the Intraclass Correlation Coefficient as Measures of ReliabilityEducational and Psychological Measurement, 1973