Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributions
Hammond Pearce, Baleegh Ahmad, Benjamin Tan, Brendan Dolan-Gavitt,, Ramesh Karri

TL;DR
This paper systematically evaluates the security of GitHub Copilot's code generation, revealing that approximately 40% of the generated code in high-risk scenarios contains vulnerabilities, raising concerns about its reliability in secure coding.
Contribution
It provides a comprehensive analysis of Copilot's tendency to produce insecure code across various prompts, weaknesses, and domains, highlighting potential security risks.
Findings
Approximately 40% of generated code was vulnerable.
Vulnerabilities appeared across diverse prompts and domains.
Copilot often recommends insecure code in high-risk scenarios.
Abstract
There is burgeoning interest in designing AI-based systems to assist humans in designing computing systems, including tools that automatically generate computer code. The most notable of these comes in the form of the first self-described `AI pair programmer', GitHub Copilot, a language model trained over open-source GitHub code. However, code often contains bugs - and so, given the vast quantity of unvetted code that Copilot has processed, it is certain that the language model will have learned from exploitable, buggy code. This raises concerns on the security of Copilot's code contributions. In this work, we systematically investigate the prevalence and conditions that can cause GitHub Copilot to recommend insecure code. To perform this analysis we prompt Copilot to generate code in scenarios relevant to high-risk CWEs (e.g. those from MITRE's "Top 25" list). We explore Copilot's…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Advanced Malware Detection Techniques · Software Testing and Debugging Techniques
