Table of Contents
Fetching ...

Poisoned ChatGPT Finds Work for Idle Hands: Exploring Developers' Coding Practices with Insecure Suggestions from Poisoned AI Models

Sanghak Oh, Kiho Lee, Seonhye Park, Doowon Kim, Hyoungshick Kim

TL;DR

The paper investigates the real-world feasibility of poisoning AI-powered coding assistants and their impact on developer-produced code through an online survey and an in-lab study with professionals. It shows high adoption and trust in code completion tools, but substantial insecure code output when interacting with poisoned models, especially for code generation. The findings reveal distinct risk profiles for code completion versus code generation and indicate that security expertise alone does not guarantee resilience to poisoning; education and secure development practices are essential. The work highlights the practical significance of securing AI-assisted software development and motivates targeted defenses, better training, and robust verification workflows for developers.

Abstract

AI-powered coding assistant tools have revolutionized the software engineering ecosystem. However, prior work has demonstrated that these tools are vulnerable to poisoning attacks. In a poisoning attack, an attacker intentionally injects maliciously crafted insecure code snippets into training datasets to manipulate these tools. The poisoned tools can suggest insecure code to developers, resulting in vulnerabilities in their products that attackers can exploit. However, it is still little understood whether such poisoning attacks against the tools would be practical in real-world settings and how developers address the poisoning attacks during software development. To understand the real-world impact of poisoning attacks on developers who rely on AI-powered coding assistants, we conducted two user studies: an online survey and an in-lab study. The online survey involved 238 participants, including software developers and computer science students. The survey results revealed widespread adoption of these tools among participants, primarily to enhance coding speed, eliminate repetition, and gain boilerplate code. However, the survey also found that developers may misplace trust in these tools because they overlooked the risk of poisoning attacks. The in-lab study was conducted with 30 professional developers. The developers were asked to complete three programming tasks with a representative type of AI-powered coding assistant tool, running on Visual Studio Code. The in-lab study results showed that developers using a poisoned ChatGPT-like tool were more prone to including insecure code than those using an IntelliCode-like tool or no tool. This demonstrates the strong influence of these tools on the security of generated code. Our study results highlight the need for education and improved coding practices to address new security issues introduced by AI-powered coding assistant tools.

Poisoned ChatGPT Finds Work for Idle Hands: Exploring Developers' Coding Practices with Insecure Suggestions from Poisoned AI Models

TL;DR

The paper investigates the real-world feasibility of poisoning AI-powered coding assistants and their impact on developer-produced code through an online survey and an in-lab study with professionals. It shows high adoption and trust in code completion tools, but substantial insecure code output when interacting with poisoned models, especially for code generation. The findings reveal distinct risk profiles for code completion versus code generation and indicate that security expertise alone does not guarantee resilience to poisoning; education and secure development practices are essential. The work highlights the practical significance of securing AI-assisted software development and motivates targeted defenses, better training, and robust verification workflows for developers.

Abstract

AI-powered coding assistant tools have revolutionized the software engineering ecosystem. However, prior work has demonstrated that these tools are vulnerable to poisoning attacks. In a poisoning attack, an attacker intentionally injects maliciously crafted insecure code snippets into training datasets to manipulate these tools. The poisoned tools can suggest insecure code to developers, resulting in vulnerabilities in their products that attackers can exploit. However, it is still little understood whether such poisoning attacks against the tools would be practical in real-world settings and how developers address the poisoning attacks during software development. To understand the real-world impact of poisoning attacks on developers who rely on AI-powered coding assistants, we conducted two user studies: an online survey and an in-lab study. The online survey involved 238 participants, including software developers and computer science students. The survey results revealed widespread adoption of these tools among participants, primarily to enhance coding speed, eliminate repetition, and gain boilerplate code. However, the survey also found that developers may misplace trust in these tools because they overlooked the risk of poisoning attacks. The in-lab study was conducted with 30 professional developers. The developers were asked to complete three programming tasks with a representative type of AI-powered coding assistant tool, running on Visual Studio Code. The in-lab study results showed that developers using a poisoned ChatGPT-like tool were more prone to including insecure code than those using an IntelliCode-like tool or no tool. This demonstrates the strong influence of these tools on the security of generated code. Our study results highlight the need for education and improved coding practices to address new security issues introduced by AI-powered coding assistant tools.
Paper Structure (35 sections, 13 figures, 2 tables)

This paper contains 35 sections, 13 figures, 2 tables.

Figures (13)

  • Figure 1: AI-Powered Coding Assistant Tools.
  • Figure 2: Code and model poisoning attacks.
  • Figure 3: Frequency of use of AI-powered tools.
  • Figure 4: Trust in code suggested by the AI-powered tools.
  • Figure 5: Trust in code suggested by the AI-powered tools with the number of correct responses in the security quiz.
  • ...and 8 more figures