Asleep at the Keyboard? Assessing the Security of GitHub Copilot’s Code Contributions
Communications of the ACM · 2025-02 · 68 (2) · 96-105
DOI: 10.1145/3610721 ↗Kurz gefasst
Fachartikel in der Zeitschrift Communications of the ACM, online erschienen am 22.01.2025. Verfasst von Hammond Pearce und 4 weiteren Autor:innen. Die Arbeit wurde bisher 173-mal zitiert (Crossref) und nennt 24 Literaturangaben. Gefördert von: National Science Foundation, Office of Naval Research.
Abstract (Originalsprache)
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, which is 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 cybersecurity weaknesses, for example, those from MITRE’s “Top 25” Common Weakness Enumeration (CWE) list. We explore Copilot’s performance on three distinct code generation axes—examining how it performs given diversity of weaknesses, diversity of prompts, and diversity of domains. In total, we produce 89 different scenarios for Copilot to complete, producing 1,689 programs. Of these, we found approximately 40% to be vulnerable.
Förderung
- National Science Foundation
- Office of Naval Research
Zitieren
APA
Pearce, H., Ahmad, B., Tan, B., Dolan-Gavitt, B., & Karri, R. (2025). Asleep at the Keyboard? Assessing the Security of GitHub Copilot’s Code Contributions. Communications of the ACM, 68(2), 96-105. https://doi.org/10.1145/3610721
Vancouver
Pearce H, Ahmad B, Tan B, Dolan-Gavitt B, Karri R. Asleep at the Keyboard? Assessing the Security of GitHub Copilot’s Code Contributions. Communications of the ACM. 2025;68(2):96-105. doi:10.1145/3610721
BibTeX
@article{Pearce2025,
author = {Pearce, Hammond and Ahmad, Baleegh and Tan, Benjamin and Dolan-Gavitt, Brendan and Karri, Ramesh},
title = {Asleep at the Keyboard? Assessing the Security of GitHub Copilot’s Code Contributions},
journal = {Communications of the ACM},
year = {2025},
volume = {68},
number = {2},
pages = {96--105},
doi = {10.1145/3610721}
}
EUVIMED