How Secure is Code Generated by ChatGPT?

04/19/2023
by   Raphaël Khoury, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
02/27/2023

The (ab)use of Open Source Code to Train Large Language Models

In recent years, Large Language Models (LLMs) have gained significant po...
research
04/25/2023

AI-assisted coding: Experiments with GPT-4

Artificial intelligence (AI) tools based on large language models have a...
research
03/25/2023

Can Large Language Models assist in Hazard Analysis?

Large Language Models (LLMs), such as GPT-3, have demonstrated remarkabl...
research
06/13/2023

ChatGPT vs. Lightweight Security: First Work Implementing the NIST Cryptographic Standard ASCON

This study, to the best of our knowledge, is the first to explore the in...
research
08/31/2022

How Readable is Model-generated Code? Examining Readability and Visual Inspection of GitHub Copilot

Background: Recent advancements in large language models have motivated ...
research
11/10/2021

Data-Driven AI Model Signal-Awareness Enhancement and Introspection

AI modeling for source code understanding tasks has been making signific...
research
07/05/2023

The FormAI Dataset: Generative AI in Software Security Through the Lens of Formal Verification

This paper presents the FormAI dataset, a large collection of 112, 000 A...

Please sign up or login with your details

Forgot password? Click here to reset