Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributions

被引:93
|
作者
Pearce, Hammond [1 ]
Ahmad, Baleegh [1 ]
Tan, Benjamin [2 ]
Dolan-Gavitt, Brendan [1 ]
Karri, Ramesh [1 ]
机构
[1] NYU, Dept ECE, Brooklyn, NY 11201 USA
[2] Univ Calgary, Dept ESE, Calgary, AB, Canada
基金
美国国家科学基金会;
关键词
Cybersecurity; Artificial Intelligence (AI); code generation; Common Weakness Enumerations (CWEs);
D O I
10.1109/SP46214.2022.00057
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
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, e.g. 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.
引用
收藏
页码:754 / 768
页数:15
相关论文
共 50 条
  • [1] Assessing the Quality of GitHub Copilot's Code Generation
    Yetistiren, Burak
    Ozsoy, Isik
    Tuzun, Eray
    [J]. PROCEEDINGS OF THE 18TH INTERNATIONAL CONFERENCE ON PREDICTIVE MODELS AND DATA ANALYTICS IN SOFTWARE ENGINEERING, PROMISE 2022, 2022, : 62 - 71
  • [2] An Empirical Evaluation of GitHub Copilot's Code Suggestions
    Nhan Nguyen
    Nadi, Sarah
    [J]. 2022 MINING SOFTWARE REPOSITORIES CONFERENCE (MSR 2022), 2022, : 1 - 5
  • [3] Is GitHub’s Copilot as bad as humans at introducing vulnerabilities in code?
    Owura Asare
    Meiyappan Nagappan
    N. Asokan
    [J]. Empirical Software Engineering, 2023, 28
  • [4] Is GitHub's Copilot as bad as humans at introducing vulnerabilities in code?
    Asare, Owura
    Nagappan, Meiyappan
    Asokan, N.
    [J]. EMPIRICAL SOFTWARE ENGINEERING, 2023, 28 (06)
  • [5] On the Robustness of Code Generation Techniques: An Empirical Study on GitHub Copilot
    Mastropaolo, Antonio
    Pascarella, Luca
    Guglielmi, Emanuela
    Ciniselli, Matteo
    Scalabrino, Simone
    Oliveto, Rocco
    Bavota, Gabriele
    [J]. 2023 IEEE/ACM 45TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, ICSE, 2023, : 2149 - 2160
  • [6] Measuring GitHub Copilot's Impact on Productivity
    Ziegler, Albert
    Kalliamvakou, Eirini
    Li, X. Alice
    Rice, Andrew
    Rifkin, Devon
    Simister, Shawn
    Sittampalam, Ganesh
    Aftandilian, Edward
    [J]. COMMUNICATIONS OF THE ACM, 2024, 67 (03) : 54 - 63
  • [7] Assessing the Use of GitHub Copilot on Students of Engineering of Information Systems
    Cirett-Galan, Federico
    Torres-Peralta, Raquel
    Navarro-Hernandez, Rene
    Ochoa-Hernandez, Jose Luis
    Contreras-Rivera, San
    Estrada-Rios, Luis Arturo
    Machado-Encinas, German
    [J]. INTERNATIONAL JOURNAL OF SOFTWARE ENGINEERING AND KNOWLEDGE ENGINEERING, 2024,
  • [8] Exploring the Effect of Multiple Natural Languages on Code Suggestion Using GitHub Copilot
    Koyanagi, Kei
    Wang, Dong
    Noguchi, Kotaro
    Kondo, Masanari
    Serebrenik, Alexander
    Kamei, Yasutaka
    Ubayashi, Naoyasu
    [J]. 2024 IEEE/ACM 21ST INTERNATIONAL CONFERENCE ON MINING SOFTWARE REPOSITORIES, MSR, 2024, : 481 - 486
  • [9] CodexLeaks: Privacy Leaks from Code Generation Language Models in GitHub Copilot
    Niu, Liang
    Mirza, Shujaat
    Maradni, Zayd
    Popper, Christina
    [J]. PROCEEDINGS OF THE 32ND USENIX SECURITY SYMPOSIUM, 2023, : 2133 - 2150
  • [10] Zero-shot Prompting for Code Complexity Prediction Using GitHub Copilot
    Siddiq, Mohammed Latif
    Samee, Abdus
    Azgor, Sk Ruhul
    Haider, Md. Asif
    Sawraz, Shehabul Islam
    Santos, Joanna C. S.
    [J]. 2023 IEEE/ACM 2ND INTERNATIONAL WORKSHOP ON NATURAL LANGUAGE-BASED SOFTWARE ENGINEERING, NLBSE, 2023, : 56 - 59