How Secure is Code Generated by ChatGPT?
Authors:
Top Cited Papers
- 1 October 2023
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- Vol. 32, 2445-2451
Abstract
In recent years, large language models have been responsible for great advances in the field of artificial intelligence (AI). ChatGPT in particular, an AI chatbot developed and recently released by OpenAI, has taken the field to the next level. The conversational model is able not only to process human-like text, but also to translate natural language into code. However, the safety of programs generated by ChatGPT should not be overlooked. In this paper, we perform an experiment to address this issue. Specifically, we ask ChatGPT to generate a number of computer programs in order to evaluate the security of the resulting source code. We further investigate whether ChatGPT can be prodded to improve code security by appropriate prompts, and discuss the ethical aspects of using AI to generate code. Results suggest that ChatGPT is aware of potential vulnerabilities, but nonetheless often generates source code that are not robust to certain attacks.Keywords
All Related Versions
This publication has 11 references indexed in Scilit:
- An Analysis of the Automatic Bug Fixing Performance of ChatGPT2023
- ChatGPT for good? On opportunities and challenges of large language models for educationLearning and Individual Differences, 2023
- ChatGPT: five priorities for researchNature, 2023
- Explainable Deep Learning: A Field Guide for the UninitiatedJournal of Artificial Intelligence Research, 2022
- GPT-3: Its Nature, Scope, Limits, and ConsequencesMinds and Machines, 2020
- The impact of regular expression denial of service (ReDoS) in practice: an empirical study at the ecosystem scale2018
- Java Deserialization Vulnerabilities and Mitigations2017
- Automatically learning semantic features for defect prediction2016
- Learning from examples to improve code completion systems2009
- A Model for When Disclosure Helps Security: What Is Different About Computer and Network Security?SSRN Electronic Journal, 2004