HackerPapers

arXiv:2304.09655cs.CR

How Secure is Code Generated by ChatGPT?

Raphaël Khoury, Anderson R. Avila, Jacob Brunelle, Baba Mamadou Camara

Early discovery. Linked by one identifiable commenter. This paper is outside the main ranking; a mention is not an endorsement.

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.

arXiv comments
Journal reference
2023 IEEE International Conference on Systems, Man, and Cybernetics (SMC) October 1-4, 2023, Oahu, Hawaii, USA
DOI
Subjects
cs.CRCryptography and Security

On Hacker News

Linked by 1 identifiable commenter in 1 comment across 1 thread, from Apr 2023 to Apr 2023. Found in 1 HN submission from Apr 2023 to Apr 2023. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments1 thread

    • The exact full prompt and methodology is missing from the paper[1] and Github repo[2], which makes this non-reproducible and not particularly useful in understanding the actual issue. I really think this sort of research is critical to do more of however as these outputs are…

      joshkaView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.