You Autocomplete Me: Poisoning Vulnerabilities in Neural Code Completion
Roei Schuster, Congzheng Song, Eran Tromer, Vitaly Shmatikov
摘要
Code autocompletion is an integral feature of modern code editors and IDEs. The latest generation of autocompleters uses neural language models, trained on public open-source code repositories, to suggest likely (not just statically feasible) completions given the current context. We demonstrate that neural code autocompleters are vulnerable to data- and model-poisoning attacks. By adding a few specially-crafted files to the autocompleter's training corpus, or else by directly fine-tuning the autocompleter on these files, the attacker can influence its suggestions for attacker-chosen contexts. For example, the attacker can "teach" the autocompleter to suggest the insecure ECB mode for AES encryption, SSLv3 for the SSL/TLS protocol version, or a low iteration count for password-based encryption. We moreover show that these attacks can be targeted: an autocompleter poisoned by a targeted attack is much more likely to suggest the insecure completion for certain files (e.g., those from a specific repo). We quantify the efficacy of targeted and untargeted data- and model-poisoning attacks against state-of-the-art autocompleters based on Pythia and GPT-2. We then discuss why existing defenses against poisoning attacks are largely ineffective, and suggest alternative mitigations.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 54 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Latent Backdoor Attacks on Deep Neural Networks 引用了 Neural Cleanse: Identifying and Mitigating Backdoor Attacks in Neural Networks
- Latent Backdoor Attacks on Deep Neural Networks 引用了 Trojaning Attack on Neural Networks
- Latent Backdoor Attacks on Deep Neural Networks 引用了 Manipulating Machine Learning: Poisoning Attacks and Countermeasures for Regression Learning
- ABS: Scanning Neural Networks for Back-doors by Artificial Brain Stimulation 引用了 Neural Cleanse: Identifying and Mitigating Backdoor Attacks in Neural Networks
- ABS: Scanning Neural Networks for Back-doors by Artificial Brain Stimulation 引用了 Trojaning Attack on Neural Networks
- ABS: Scanning Neural Networks for Back-doors by Artificial Brain Stimulation 引用了 Manipulating Machine Learning: Poisoning Attacks and Countermeasures for Regression Learning
- Exploiting LLM Quantization 引用了 Poisoning Web-Scale Training Datasets is Practical
- Exploiting LLM Quantization 引用了 On the Exploitability of Instruction Tuning
- Poisoning Web-Scale Training Datasets is Practical 引用了 Latent Backdoor Attacks on Deep Neural Networks
- Poisoning Web-Scale Training Datasets is Practical 引用了 Manipulating Machine Learning: Poisoning Attacks and Countermeasures for Regression Learning
- Poisoning Web-Scale Training Datasets is Practical 引用了 ABS: Scanning Neural Networks for Back-doors by Artificial Brain Stimulation
- On the Exploitability of Instruction Tuning 引用了 Poisoning Language Models During Instruction Tuning
- On the Exploitability of Instruction Tuning 引用了 Poisoning Web-Scale Training Datasets is Practical
引用它的顶会 Paper54
- Poisoning Language Models During Instruction TuningAlexander Wan, Eric Wallace, Sheng Shen, Dan KleinICML 2023 · 319 次引用
- Poisoning Web-Scale Training Datasets is PracticalNicholas Carlini, Matthew Jagielski, Christopher A. Choquette-Choo, Daniel Paleka 等S&P 2024 · 309 次引用
- On the Exploitability of Instruction TuningManli Shu, Jiongxiao Wang, Chen Zhu, Jonas Geiping 等NeurIPS 2023 · 166 次引用
- Natural Attack for Pre-trained Models of CodeZhou Yang, Jieke Shi, Junda He, David LoICSE 2022 · 150 次引用
- Exploiting LLM QuantizationKazuki Egashira, Mark Vero, Robin Staab, Jingxuan He 等NeurIPS 2024 · 104 次引用
它引用的 Paper16
- Neural Cleanse: Identifying and Mitigating Backdoor Attacks in Neural NetworksBolun Wang, Yuanshun Yao, Shawn Shan, Huiying Li 等S&P 2019 · 1,801 次引用
- Trojaning Attack on Neural NetworksYingqi Liu, Shiqing Ma, Yousra Aafer, Wen-Chuan Lee 等NDSS 2018 · 1,377 次引用
- Manipulating Machine Learning: Poisoning Attacks and Countermeasures for Regression LearningMatthew Jagielski, Alina Oprea, Battista Biggio, Chang Liu 等S&P 2018 · 867 次引用
- ABS: Scanning Neural Networks for Back-doors by Artificial Brain StimulationYingqi Liu, Wen-Chuan Lee, Guanhong Tao, Shiqing Ma 等CCS 2019 · 531 次引用
- Latent Backdoor Attacks on Deep Neural NetworksYuanshun Yao, Huiying Li, Haitao Zheng, Ben Y. ZhaoCCS 2019 · 465 次引用
相关 Paper
- TrojanPuzzle: Covertly Poisoning Code-Suggestion ModelsHojjat Aghakhani, Wei Dai, Andre Manoel, Xavier Fernandes 等S&P 2024 · 70 次引用
- Poison with Style: A Practical Poisoning Attack on Code Large Language ModelsKhang Tran, Yazan Boshmaf, Issa Khalil, Hai Phan 等ICML 2026
- Black-Box Adversarial Attacks on LLM-Based Code CompletionSlobodan Jenko, Niels Mündler, Jingxuan He, Mark Vero 等ICML 2025
- An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong DetectionShenao Yan, Shen Wang, Yue Duan, Hanbin Hong 等USENIX Security 2024 · 63 次引用
- Poisoned ChatGPT Finds Work for Idle Hands: Exploring Developers' Coding Practices with Insecure Suggestions from Poisoned AI ModelsSanghak Oh, Kiho Lee, Seonhye Park, Doowon Kim 等S&P 2024 · 42 次引用
