vix.ing · top · new · best · stats

How Secure is Code Generated by ChatGPT?

2023/04/19 by Raphaël Khoury, Anderson R. Avila, Khoury, Raphaël +5 · 1 voice · 29 citations
Computer Science · Medicine · #Advanced Malware Detection Techniques #Adversarial Robustness in Machine Learning #Artificial Intelligence in Healthcare and Education #cs.CR

paper · pdf · doi:10.48550/arxiv.2304.09655

arxiv published 2023/04/19 · arxiv updated 2026/04/07

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.

Cited by

Discussions

Related