mlsanityData to 7 Oct 2026

Security Weaknesses of Copilot-Generated Code in GitHub Projects: An Empirical Study

arXiv 2310.02059 ↗First posted 3 Oct 2023cs.SE cs.CRcited by 36

Not on the map. Why?

Abstract (arXiv)

Modern code generation tools utilizing AI models like Large Language Models (LLMs) have gained increased popularity due to their ability to produce functional code. However, their usage presents security challenges, often resulting in insecure code merging into the code base. Thus, evaluating the quality of generated code, especially its security, is crucial. While prior research explored various aspects of code generation, the focus on security has been limited, mostly examining code produced in controlled environments rather than open source development scenarios. To address this gap, we conducted an empirical study, analyzing code snippets generated by GitHub Copilot and two other AI code generation tools (i.e., CodeWhisperer and Codeium) from GitHub projects. Our analysis identified 733 snippets, revealing a high likelihood of security weaknesses, with 29.5% of Python and 24.2% of JavaScript snippets affected. These issues span 43 Common Weakness Enumeration (CWE) categories, including significant ones like CWE-330: Use of Insufficiently Random Values, CWE-94: Improper Control of Generation of Code, and CWE-79: Cross-site Scripting. Notably, eight of those CWEs are among the 2023 CWE Top-25, highlighting their severity. We further examined using Copilot Chat to fix security issues in Copilot-generated code by providing Copilot Chat with warning messages from the static analysis tools, and up to 55.5% of the security issues can be fixed. We finally provide the suggestions for mitigating security issues in generated code.

Key facts. Cited by 36 papers in the map (data through 7 Oct 2026). First posted on arXiv 3 Oct 2023.

Builds on

No reference list yet.

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2024: 2; 2025: 9; 2026: 25.

36 papers.

Sort:

By area:

  1. 2026SWE-chat: Coding Agent Interactions From Real Users in the Wildcited by 36
  2. 2024From Vulnerabilities to Remediation: A Systematic Literature Review of LLMs in Code Securitycited by 9
  3. 2025SV-TrustEval-C: Evaluating Structure and Semantic Reasoning in Large Language Models for Source Code Vulnerability Analysiscited by 8
  4. 2025A Systematic Literature Review on Detecting Software Vulnerabilities with Large Language Modelscited by 8
  5. 2025On LLMs' Internal Representation of Code Correctnesscited by 5
  6. 2025AI Code in the Wild: Measuring Security Risks and Ecosystem Shifts of AI-Generated Code in Modern Softwarecited by 4
  7. 2024Demystifying Issues, Causes and Solutions in LLM Open-Source Projectscited by 3
  8. 2025Is Your Prompt Poisoning Code? Defect Induction Rates and Security Mitigation Strategiescited by 3
  9. 2026Are We All Using Agents the Same Way? An Empirical Study of Core and Peripheral Developers Use of Coding Agentscited by 3
  10. 2026Agentic AI in Industry: Adoption Level and Deployment Barrierscited by 3
  11. 2026What Breaks When LLMs Code? Characterizing Operational Safety Failures of Agentic Code Assistantscited by 3
  12. 2025An Empirical Study of Vulnerabilities in Python Packages and Their Detectioncited by 2
24 more
  1. 2025CoTDeceptor:Adversarial Code Obfuscation Against CoT-Enhanced LLM Code Agentscited by 2
  2. 2025DualGauge: Automated Joint Security-Functionality Benchmarking of Specification-Only Code Generation by LLMs and Coding Agentscited by 1
  3. 2026Just-in-Time Catching Test Generation at Metacited by 1
  4. 2026RocqSmith: Can Automatic Optimization Forge Better Proof Agents?cited by 1
  5. 2026Correct Code, Vulnerable Dependencies: A Large Scale Measurement Study of LLM-Specified Library Versionscited by 1
  6. 2026Enhancing Reliability in LLM-Based Secure Code Generationcited by 1
  7. 2026On the Robustness of LLMs' Internal Representation of Code Correctnesscited by 1
  8. 2025Designing Empirical Studies on LLM-Based Code Generation: Towards a Reference Frameworkcited by 0
  9. 2026EyeLayer: Integrating Human Attention Patterns into LLM-Based Code Summarizationcited by 0
  10. 2026Detecting Data Poisoning in Code Generation LLMs via Black-Box, Vulnerability-Oriented Scanningcited by 0
  11. 2026A Quasi-Experimental Developer Study of Security Training in LLM-Assisted Web Application Developmentcited by 0
  12. 2026SecureForge: Finding and Preventing Vulnerabilities in LLM-Generated Code via Prompt Optimizationcited by 0
  13. 2026Quality and Security Signals in AI-Generated Python Refactoring Pull Requestscited by 0
  14. 2026Short-Term Gain, Long-Term Fragility: AI Labor Substitution and the Erosion of Sustainable Capabilitycited by 0
  15. 2026Helpful or Harmful? Evaluating LLM-Assisted Vulnerability Patching via a Human Studycited by 0
  16. 2026Understanding the Impact of AI Code Assistants on Security API Usage: An Empirical Studycited by 0
  17. 2026The Hitchhiker's Guide to Monoculture: AI Homogenizes Syntax, Not (Necessarily) Semanticscited by 0
  18. 2026Design Theater: Evaluating the Gap Between User-Facing Design Reasoning and Implementation in Generative UI Toolscited by 0
  19. 2026The Illusion of Secure LLM Code: Closing the Security Gap via Iterative Repromptingcited by 0
  20. 2026LangChoiceBench: Measuring and Explaining Programming-Language Choice in LLMscited by 0
  21. 2026Activation Probes Surface Code-Security Signals that the Model's Output Missescited by 0
  22. 2026Vibe Coding and Web Application Security: A Twin-Prompt Studycited by 0
  23. 2026What is the Difference Between Me and You? Benchmarking the Quality Gap Between Human-Written and AI-Generated Codecited by 0
  24. 2026Not All Agents Are Equal: Code Quality and Post-Merge Maintenance Across Five Autonomous Coding Agents in the Wildcited by 0