AIセキュリティポータル K Program
How Secure is Code Generated by ChatGPT?
Share
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 program and evaluate the security of the resulting source code. We further investigate whether ChatGPT can be prodded to improve the 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.
Gpt-3: Its nature, scope, limits, and consequences
L. Floridi, M. Chiriatti
Published: 2020
Chatgpt: five priorities for research
E. A. van Dis, J. Bollen, W. Zuidema, R. van Rooij, C. L. Bockting
Published: 2023
Chatgpt for good? on opportunities and challenges of large language models for education
Enkelejda Kasneci, Kathrin Seßler, Stefan Küchemann, Maria Bannert, Daryna Dementieva, Frank Fischer, Urs Gasser, Georg Groh, Stephan Günnemann, Eyke Hüller-meier, et al.
Published: 2023
Automatically learning semantic features for defect prediction
Song Wang, Taiyue Liu, Lin Tan
Published: 2016
Program synthesis and semantic parsing with learned code idioms
E. C. Shin, M. Allamanis, M. Brockschmidt, A. Polozov
Published: 2019
Learning from examples to improve code completion systems
M. Bruch, M. Monperrus, M. Mezini
Published: 2009
Secure programming cookbook for C and C++: recipes for cryptography, authentication, input validation & more
J. Viega, M. Messier
Published: 2003
Java deserialization vulnerabilities and mitigations
R. C. Seacord
Published: 2017
A qualitative study of vulnerability-fixing commits
M. Mkhallalati
Published: 2019
More than half of college students believe using chatgpt to complete assignments is cheating
M. Nietzel
Published: 2023
A model for when disclosure helps security: What is different about computer and network security?
P. Swire
Published: 2004
Explainable deep learning: A field guide for the uninitiated
G. Ras, N. Xie, M. Van Gerven, D. Doran
Published: 2022
Generating secure hardware using chatgpt resistant to cwes
M. Nair, R. Sadhukhan, D. Mukhopadhyay
Published: 2023
Share