ChatGPT生成的代码安全性如何?
How Secure is Code Generated by ChatGPT?
AI总结:
研究评估了ChatGPT生成代码的安全性,探讨了通过提示提高安全性的方法及AI生成代码的伦理问题。
摘要:
近年来,大型语言模型在人工智能领域取得了重大进展。ChatGPT,由OpenAI开发并近期发布的人工智能聊天机器人,将该领域推向了新的高度。对话模型不仅能处理类人文本,还能将自然语言转换为代码。然而,ChatGPT生成的程序的安全性不应被忽视。本文通过实验探讨这一问题。具体而言,我们要求ChatGPT生成若干程序并评估生成源代码的安全性。我们进一步研究是否可以通过适当提示提高安全性,并讨论使用AI生成代码的伦理问题。结果表明,ChatGPT意识到潜在漏洞,但仍然经常生成对某些攻击不鲁棒的源代码。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。