CodexLeaks: Privacy Leaks from Code Generation Language Models in GitHub Copilot
Liang Niu, Muhammad Shujaat Mirza, Zayd Maradni, Christina Pöpper
摘要
Code generation language models are trained on billions of lines of source code to provide code generation and autocompletion features, like those offered by code assistant GitHub Copilot with more than a million users. These datasets may contain sensitive personal information-personally identifiable, private, or secret-that these models may regurgitate. This paper introduces and evaluates a semi-automated pipeline for extracting sensitive personal information from the Codex model used in GitHub Copilot. We employ carefullydesigned templates to construct prompts that are more likely to result in privacy leaks. To overcome the non-public training data, we propose a semi-automated filtering method using a blind membership inference attack. We validate the effectiveness of our membership inference approach on different code generation models. We utilize hit rate through the GitHub Search API as a distinguishing heuristic followed by humanin-the-loop evaluation, uncovering that approximately 8% (43) of the prompts yield privacy leaks. Notably, we observe that the model tends to produce indirect leaks, compromising privacy as contextual integrity by generating information from individuals closely related to the queried subject in the training corpus.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 19 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Chasing Shadows: Pitfalls in LLM Security Research 引用了 Language Models are Few-Shot Learners
- Decoding Secret Memorization in Code LLMs Through Token-Level Characterization 引用了 The Secret Sharer: Evaluating and Testing Unintended Memorization in Neural Networks
- Decoding Secret Memorization in Code LLMs Through Token-Level Characterization 引用了 Extracting Training Data from Large Language Models
- The Secret Sharer: Evaluating and Testing Unintended Memorization in Neural Networks 引用了 Membership Inference Attacks Against Machine Learning Models
- Language Models are Few-Shot Learners 引用了 The Curious Case of Neural Text Degeneration
- User Inference Attacks on Large Language Models 引用了 Membership Inference Attacks Against Machine Learning Models
- Extracting Training Data from Large Language Models 引用了 Membership Inference Attacks Against Machine Learning Models
- Extracting Training Data from Large Language Models 引用了 The Secret Sharer: Evaluating and Testing Unintended Memorization in Neural Networks
- Extracting Training Data from Large Language Models 引用了 Language Models are Few-Shot Learners
- Extracting Training Data from Large Language Models 引用了 The Curious Case of Neural Text Degeneration
引用它的顶会 Paper19
- Parasites in the Toolchain: A Large-Scale Analysis of Attacks on the MCP EcosystemShuli Zhao, Qinsheng Hou, Zihan Zhan, Yanhao Wang 等S&P 2026 · 20 次引用
- Chasing Shadows: Pitfalls in LLM Security ResearchJonathan Evertz, Niklas Risse, Nicolai Neuer, Andreas Müller 等NDSS 2026 · 17 次引用
- Using AI Assistants in Software Development: A Qualitative Study on Security Practices and ConcernsJan H. Klemmer, Stefan Albert Horstmann, Nikhil Patnaik, Cordelia Ludden 等CCS 2024 · 14 次引用
- User Inference Attacks on Large Language ModelsNikhil Kandpal, Krishna Pillutla, Alina Oprea, Peter Kairouz 等EMNLP 2024 · 14 次引用
- Decoding Secret Memorization in Code LLMs Through Token-Level CharacterizationYuqing Nie, Chong Wang, Kailong Wang, Guoai Xu 等ICSE 2025 · 10 次引用
它引用的 Paper19
- Language Models are Few-Shot LearnersTom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah 等NeurIPS 2020 · 64,255 次引用
- Membership Inference Attacks Against Machine Learning ModelsReza Shokri, Marco Stronati, Congzheng Song, Vitaly ShmatikovS&P 2017 · 5,137 次引用
- The Curious Case of Neural Text DegenerationAri Holtzman, Jan Buys, Li Du, Maxwell Forbes 等ICLR 2020 · 4,112 次引用
- Extracting Training Data from Large Language ModelsNicholas Carlini, Florian Tramèr, Eric Wallace, Matthew Jagielski 等USENIX Security 2021 · 2,866 次引用
- The Secret Sharer: Evaluating and Testing Unintended Memorization in Neural NetworksNicholas Carlini, Chang Liu, Úlfar Erlingsson, Jernej Kos 等USENIX Security 2019 · 1,386 次引用
相关 Paper
- Codebreaker: Dynamic Extraction Attacks on Code Language ModelsChangzhou Han, Zehang Deng, Wanlun Ma, Xiaogang Zhu 等S&P 2025
- Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code ContributionsHammond Pearce, Baleegh Ahmad, Benjamin Tan, Brendan Dolan-Gavitt 等S&P 2022 · 725 次引用
- Uncovering and Quantifying Social Biases in Code GenerationYan Liu, Xiaokang Chen, Yan Gao, Zhe Su 等NeurIPS 2023 · 47 次引用
- Security Attacks on LLM-based Code Completion ToolsWen Cheng, Ke Sun, Xinyu Zhang, Wei WangAAAI 2025 · 21 次引用
- Black-Box Adversarial Attacks on LLM-Based Code CompletionSlobodan Jenko, Niels Mündler, Jingxuan He, Mark Vero 等ICML 2025
