TrojanPuzzle: Covertly Poisoning Code-Suggestion Models
Not on the map. Why?
Abstract (arXiv)
With tools like GitHub Copilot, automatic code suggestion is no longer a dream in software engineering. These tools, based on large language models, are typically trained on massive corpora of code mined from unvetted public sources. As a result, these models are susceptible to data poisoning attacks where an adversary manipulates the model's training by injecting malicious data. Poisoning attacks could be designed to influence the model's suggestions at run time for chosen contexts, such as inducing the model into suggesting insecure code payloads. To achieve this, prior attacks explicitly inject the insecure code payload into the training data, making the poison data detectable by static analysis tools that can remove such malicious data from the training set. In this work, we demonstrate two novel attacks, COVERT and TROJANPUZZLE, that can bypass static analysis by planting malicious poison data in out-of-context regions such as docstrings. Our most novel attack, TROJANPUZZLE, goes one step further in generating less suspicious poison data by never explicitly including certain (suspicious) parts of the payload in the poison data, while still inducing a model that suggests the entire payload when completing code (i.e., outside docstrings). This makes TROJANPUZZLE robust against signature-based dataset-cleansing methods that can filter out suspicious sequences from the training data. Our evaluation against models of two sizes demonstrates that both COVERT and TROJANPUZZLE have significant implications for practitioners when selecting code used to train or tune code-suggestion models.
Key facts. Cited by 47 papers in the map (data through 7 Oct 2026). Builds on 42 of its 69 references that are in the map. First posted on arXiv 6 Jan 2023.
Builds on
42 of 69 references.
References · 42
- 2017Attention Is All You Needcited by 59,932
- 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
- 2020Language Models are Few-Shot Learnerscited by 32,199
- 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2021Program Synthesis with Large Language Modelscited by 3,509
- 2019The Curious Case of Neural Text Degenerationcited by 2,881
- 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
- 2020Extracting Training Data from Large Language Modelscited by 2,144
- 2022Competition-Level Code Generation with AlphaCodecited by 1,427
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
- 2017Targeted Backdoor Attacks on Deep Learning Systems Using Data Poisoningcited by 1,012
30 more
- 2018The Secret Sharer: Evaluating and Testing Unintended Memorization in Neural Networkscited by 847
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
- 2020Self-supervised Learning: Generative or Contrastivecited by 693
- 2018Fine-Pruning: Defending Against Backdooring Attacks on Deep Neural Networkscited by 550
- 2020Pre-trained Models for Natural Language Processing: A Surveycited by 504
- 2018Poison Frogs! Targeted Clean-Label Poisoning Attacks on Neural Networkscited by 500
- 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
- 2018Spectral Signatures in Backdoor Attackscited by 457
- 2018Detecting Backdoor Attacks on Deep Neural Networks by Activation Clusteringcited by 429
- 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 417
- 2019Hidden Trigger Backdoor Attackscited by 359
- 2021Pre-Trained Models: Past, Present and Futurecited by 319
- 2019A backdoor attack against LSTM-based text classification systemscited by 214
- 2021Hidden Killer: Invisible Textual Backdoor Attacks with Syntactic Triggercited by 203
- 2019Detecting AI Trojans Using Meta Neural Analysiscited by 192
- 2022Do Users Write More Insecure Code with AI Assistants?cited by 186
- 2020Witches' Brew: Industrial Scale Data Poisoning via Gradient Matchingcited by 156
- 2019Transferable Clean-Label Poisoning Attacks on Deep Neural Netscited by 129
- 2020Adversarial Machine Learning -- Industry Perspectivescited by 121
- 2020MetaPoison: Practical General-purpose Clean-label Data Poisoningcited by 114
- 2020You Autocomplete Me: Poisoning Vulnerabilities in Neural Code Completioncited by 112
- 2021Turn the Combination Lock: Learnable Textual Backdoor Attacks via Word Substitutioncited by 85
- 2020Trojaning Language Models for Fun and Profitcited by 80
- 2020Bullseye Polytope: A Scalable Clean-Label Poisoning Attack with Improved Transferabilitycited by 65
- 2021T-Miner: A Generative Approach to Defend Against Trojan Attacks on DNN-based Text Classificationcited by 56
- 2019Pythia: AI-assisted Code Completion Systemcited by 54
- 2020Poison Attacks against Text Datasets with Conditional Adversarially Regularized Autoencodercited by 27
- 2020BAAAN: Backdoor Attacks Against Autoencoder and GAN-Based Machine Learning Modelscited by 23
- 2017Automated Poisoning Attacks and Defenses in Malware Detection Systems: An Adversarial Machine Learning Approachcited by 18
- 2020VenoMave: Targeted Poisoning Against Speech Recognitioncited by 7
Built on by
Citing papers per year: 2023: 7; 2024: 12; 2025: 16; 2026: 12.
47 papers.
Sort:
By area:
- 2023A Survey on Large Language Model (LLM) Security and Privacy: The Good, the Bad, and the Uglycited by 380
- 2024Security and Privacy Challenges of Large Language Models: A Surveycited by 179
- 2023Learning Performance-Improving Code Editscited by 103
- 2023A Survey of Safety and Trustworthiness of Large Language Models through the Lens of Verification and Validationcited by 91
- 2024Navigating the Risks: A Survey of Security, Privacy, and Ethics Threats in LLM-Based Agentscited by 63
- 2023Privacy in Large Language Models: Attacks, Defenses and Future Directionscited by 48
- 2024A Performance Study of LLM-Generated Code on Leetcodecited by 48
- 2023StudentEval: A Benchmark of Student-Written Prompts for Large Language Models of Codecited by 32
- 2024An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong Detectioncited by 32
- 2023DeceptPrompt: Exploiting LLM-driven Code Generation via Adversarial Natural Language Instructionscited by 31
- 2023Vulnerabilities in AI Code Generators: Exploring Targeted Data Poisoning Attackscited by 29
- 2024CleanGen: Mitigating Backdoor Attacks for Generation Tasks in Large Language Modelscited by 20
35 more
- 2025Don't Pass@k: A Bayesian Framework for Large Language Model Evaluationcited by 15
- 2024LiCoEval: Evaluating LLMs on License Compliance in Code Generationcited by 13
- 2024Black-Box Adversarial Attacks on LLM-Based Code Completioncited by 13
- 2024CLIBE: Detecting Dynamic Backdoors in Transformer-based NLP Modelscited by 11
- 2024Exploring Vulnerabilities and Protections in Large Language Models: A Surveycited by 10
- 2025VeriLeaky: Navigating IP Protection vs Utility in Fine-Tuning for LLM-Driven Verilog Codingcited by 10
- 2024From Vulnerabilities to Remediation: A Systematic Literature Review of LLMs in Code Securitycited by 9
- 2025RedCodeAgent: Automatic Red-teaming Agent against Diverse Code Agentscited by 9
- 2026A Systematic Survey of Security Threats and Defenses in LLM-Based AI Agents: A Layered Attack Surface Frameworkcited by 9
- 2025A Systematic Review of Poisoning Attacks Against Large Language Modelscited by 8
- 2025RedCoder: Automated Multi-Turn Red Teaming for Code LLMscited by 8
- 2025RAG-Pull: Turning Retrieval into a Code-Injection Channel via Invisible Unicode Perturbationscited by 4
- 2026Beware What You Autocomplete: Forensic Attribution of Backdoored Code Completionscited by 4
- 2025Trust Me, I Know This Function: Hijacking LLM Static Analysis using Biascited by 3
- 2025A First Look at the Security Issues in the Model Context Protocol Ecosystemcited by 3
- 2026"I'm Not Reading All of That": Understanding Software Engineers' Level of Cognitive Engagement with Agentic Coding Assistantscited by 3
- 2024Code Vulnerability Repair with Large Language Model using Context-Aware Prompt Tuningcited by 2
- 2025Scam2Prompt: A Scalable Framework for Auditing Malicious Scam Endpoints in Production LLMscited by 2
- 2025From Poisoned to Aware: Fostering Backdoor Self-Awareness in LLMscited by 2
- 2025CoTDeceptor:Adversarial Code Obfuscation Against CoT-Enhanced LLM Code Agentscited by 2
- 2024Trojans in Large Language Models of Code: A Critical Review through a Trigger-Based Taxonomycited by 1
- 2025Investigating Security Implications of Automatically Generated Code on the Software Supply Chaincited by 1
- 2026Poison with Style: A Practical Poisoning Attack on Code Large Language Modelscited by 1
- 2026SEVRA-BENCH: Social Engineering of Vulnerabilities in Review Agentscited by 1
- 2025Poisoned Source Code Detection in Code Modelscited by 0
- 2025Large Language Models in Cybersecurity: Applications, Vulnerabilities, and Defense Techniquescited by 0
- 2025A Systematic Evaluation of Parameter-Efficient Fine-Tuning Methods for the Security of Code LLMscited by 0
- 2025SoK: Understanding (New) Security Issues Across AI4Code Use Casescited by 0
- 2026Detecting Data Poisoning in Code Generation LLMs via Black-Box, Vulnerability-Oriented Scanningcited by 0
- 2026Security of LLM-generated Code: A Comparative Analysiscited by 0
- 2026A Red Teaming Framework for Large Language Models: A Case Study on Faithfulness Evaluationcited by 0
- 2026Words Speak Louder Than Code: Investigating Cognitive Heuristics in LLM-Based Code Vulnerability Detectioncited by 0
- 2026Fixed-Set Robustness in Programming by Example: Example Corruption and Semantic Partition Recoverycited by 0
- 2026Builder, Defender, Breaker: Measurable Independence and Bounded Autonomy When Generative Models Build, Defend and Test Softwarecited by 0
- 2026Reflections on Trusting Trust, Revisited: Contaminating Self-Modifying AI Coding Agents with Poisoned Benchmarkscited by 0
- 2026Reflections on Trusting Trust, Revisited: Contaminating Self-Modifying AI Coding Agents with Poisoned Benchmarks15 Sep 2026
- 2026Beware What You Autocomplete: Forensic Attribution of Backdoored Code Completions9 Jul 2026
- 2026Builder, Defender, Breaker: Measurable Independence and Bounded Autonomy When Generative Models Build, Defend and Test Software3 Jul 2026
- 2026Fixed-Set Robustness in Programming by Example: Example Corruption and Semantic Partition Recovery1 Jul 2026
- 2026Words Speak Louder Than Code: Investigating Cognitive Heuristics in LLM-Based Code Vulnerability Detection29 Jun 2026
- 2026A Red Teaming Framework for Large Language Models: A Case Study on Faithfulness Evaluation24 Jun 2026
- 2026SEVRA-BENCH: Social Engineering of Vulnerabilities in Review Agents11 Jun 2026
- 2026Poison with Style: A Practical Poisoning Attack on Code Large Language Models26 May 2026
- 2026Security of LLM-generated Code: A Comparative Analysis21 May 2026
- 2026A Systematic Survey of Security Threats and Defenses in LLM-Based AI Agents: A Layered Attack Surface Framework25 Apr 2026
- 2026Detecting Data Poisoning in Code Generation LLMs via Black-Box, Vulnerability-Oriented Scanning17 Mar 2026
- 2026"I'm Not Reading All of That": Understanding Software Engineers' Level of Cognitive Engagement with Agentic Coding Assistants15 Mar 2026
35 more
- 2025CoTDeceptor:Adversarial Code Obfuscation Against CoT-Enhanced LLM Code Agents24 Dec 2025
- 2025SoK: Understanding (New) Security Issues Across AI4Code Use Cases20 Dec 2025
- 2025A First Look at the Security Issues in the Model Context Protocol Ecosystem18 Oct 2025
- 2025RAG-Pull: Turning Retrieval into a Code-Injection Channel via Invisible Unicode Perturbations13 Oct 2025
- 2025From Poisoned to Aware: Fostering Backdoor Self-Awareness in LLMs5 Oct 2025
- 2025Don't Pass@k: A Bayesian Framework for Large Language Model Evaluation5 Oct 2025
- 2025RedCodeAgent: Automatic Red-teaming Agent against Diverse Code Agents2 Oct 2025
- 2025Investigating Security Implications of Automatically Generated Code on the Software Supply Chain24 Sep 2025
- 2025A Systematic Evaluation of Parameter-Efficient Fine-Tuning Methods for the Security of Code LLMs16 Sep 2025
- 2025Scam2Prompt: A Scalable Framework for Auditing Malicious Scam Endpoints in Production LLMs2 Sep 2025
- 2025Trust Me, I Know This Function: Hijacking LLM Static Analysis using Bias24 Aug 2025
- 2025Large Language Models in Cybersecurity: Applications, Vulnerabilities, and Defense Techniques18 Jul 2025
- 2025RedCoder: Automated Multi-Turn Red Teaming for Code LLMs25 Jun 2025
- 2025A Systematic Review of Poisoning Attacks Against Large Language Models6 Jun 2025
- 2025VeriLeaky: Navigating IP Protection vs Utility in Fine-Tuning for LLM-Driven Verilog Coding17 Mar 2025
- 2025Poisoned Source Code Detection in Code Models19 Feb 2025
- 2024From Vulnerabilities to Remediation: A Systematic Literature Review of LLMs in Code Security19 Dec 2024
- 2024Navigating the Risks: A Survey of Security, Privacy, and Ethics Threats in LLM-Based Agents14 Nov 2024
- 2024Code Vulnerability Repair with Large Language Model using Context-Aware Prompt Tuning27 Sep 2024
- 2024CLIBE: Detecting Dynamic Backdoors in Transformer-based NLP Models2 Sep 2024
- 2024Black-Box Adversarial Attacks on LLM-Based Code Completion5 Aug 2024
- 2024LiCoEval: Evaluating LLMs on License Compliance in Code Generation5 Aug 2024
- 2024A Performance Study of LLM-Generated Code on Leetcode31 Jul 2024
- 2024CleanGen: Mitigating Backdoor Attacks for Generation Tasks in Large Language Models18 Jun 2024
- 2024An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong Detection10 Jun 2024
- 2024Exploring Vulnerabilities and Protections in Large Language Models: A Survey1 Jun 2024
- 2024Trojans in Large Language Models of Code: A Critical Review through a Trigger-Based Taxonomy5 May 2024
- 2024Security and Privacy Challenges of Large Language Models: A Survey30 Jan 2024
- 2023DeceptPrompt: Exploiting LLM-driven Code Generation via Adversarial Natural Language Instructions7 Dec 2023
- 2023A Survey on Large Language Model (LLM) Security and Privacy: The Good, the Bad, and the Ugly4 Dec 2023
- 2023Privacy in Large Language Models: Attacks, Defenses and Future Directions16 Oct 2023
- 2023Vulnerabilities in AI Code Generators: Exploring Targeted Data Poisoning Attacks4 Aug 2023
- 2023StudentEval: A Benchmark of Student-Written Prompts for Large Language Models of Code7 Jun 2023
- 2023A Survey of Safety and Trustworthiness of Large Language Models through the Lens of Verification and Validation19 May 2023
- 2023Learning Performance-Improving Code Edits15 Feb 2023
- 2024Security and Privacy Challenges of Large Language Models: A Surveycited by 179
- 2024An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong Detectioncited by 32
- 2023Vulnerabilities in AI Code Generators: Exploring Targeted Data Poisoning Attackscited by 29
- 2024CleanGen: Mitigating Backdoor Attacks for Generation Tasks in Large Language Modelscited by 20
- 2024CLIBE: Detecting Dynamic Backdoors in Transformer-based NLP Modelscited by 11
- 2024Exploring Vulnerabilities and Protections in Large Language Models: A Surveycited by 10
- 2025RedCoder: Automated Multi-Turn Red Teaming for Code LLMscited by 8
- 2026Beware What You Autocomplete: Forensic Attribution of Backdoored Code Completionscited by 4
- 2025From Poisoned to Aware: Fostering Backdoor Self-Awareness in LLMscited by 2
- 2026Detecting Data Poisoning in Code Generation LLMs via Black-Box, Vulnerability-Oriented Scanningcited by 0
- 2026A Red Teaming Framework for Large Language Models: A Case Study on Faithfulness Evaluationcited by 0
- 2026Beware What You Autocomplete: Forensic Attribution of Backdoored Code Completions9 Jul 2026
- 2026A Red Teaming Framework for Large Language Models: A Case Study on Faithfulness Evaluation24 Jun 2026
- 2026Detecting Data Poisoning in Code Generation LLMs via Black-Box, Vulnerability-Oriented Scanning17 Mar 2026
- 2025From Poisoned to Aware: Fostering Backdoor Self-Awareness in LLMs5 Oct 2025
- 2025RedCoder: Automated Multi-Turn Red Teaming for Code LLMs25 Jun 2025
- 2024CLIBE: Detecting Dynamic Backdoors in Transformer-based NLP Models2 Sep 2024
- 2024CleanGen: Mitigating Backdoor Attacks for Generation Tasks in Large Language Models18 Jun 2024
- 2024An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong Detection10 Jun 2024
- 2024Exploring Vulnerabilities and Protections in Large Language Models: A Survey1 Jun 2024
- 2024Security and Privacy Challenges of Large Language Models: A Survey30 Jan 2024
- 2023Vulnerabilities in AI Code Generators: Exploring Targeted Data Poisoning Attacks4 Aug 2023
- 2024Navigating the Risks: A Survey of Security, Privacy, and Ethics Threats in LLM-Based Agentscited by 63
- 2025RedCodeAgent: Automatic Red-teaming Agent against Diverse Code Agentscited by 9
- 2026A Systematic Survey of Security Threats and Defenses in LLM-Based AI Agents: A Layered Attack Surface Frameworkcited by 9
- 2025A First Look at the Security Issues in the Model Context Protocol Ecosystemcited by 3
- 2026"I'm Not Reading All of That": Understanding Software Engineers' Level of Cognitive Engagement with Agentic Coding Assistantscited by 3
- 2025CoTDeceptor:Adversarial Code Obfuscation Against CoT-Enhanced LLM Code Agentscited by 2
- 2026SEVRA-BENCH: Social Engineering of Vulnerabilities in Review Agentscited by 1
- 2026Reflections on Trusting Trust, Revisited: Contaminating Self-Modifying AI Coding Agents with Poisoned Benchmarkscited by 0
- 2026Reflections on Trusting Trust, Revisited: Contaminating Self-Modifying AI Coding Agents with Poisoned Benchmarks15 Sep 2026
- 2026SEVRA-BENCH: Social Engineering of Vulnerabilities in Review Agents11 Jun 2026
- 2026A Systematic Survey of Security Threats and Defenses in LLM-Based AI Agents: A Layered Attack Surface Framework25 Apr 2026
- 2026"I'm Not Reading All of That": Understanding Software Engineers' Level of Cognitive Engagement with Agentic Coding Assistants15 Mar 2026
- 2025CoTDeceptor:Adversarial Code Obfuscation Against CoT-Enhanced LLM Code Agents24 Dec 2025
- 2025A First Look at the Security Issues in the Model Context Protocol Ecosystem18 Oct 2025
- 2025RedCodeAgent: Automatic Red-teaming Agent against Diverse Code Agents2 Oct 2025
- 2024Navigating the Risks: A Survey of Security, Privacy, and Ethics Threats in LLM-Based Agents14 Nov 2024
- 2023A Survey on Large Language Model (LLM) Security and Privacy: The Good, the Bad, and the Uglycited by 380
- 2023Learning Performance-Improving Code Editscited by 103
- 2023A Survey of Safety and Trustworthiness of Large Language Models through the Lens of Verification and Validationcited by 91
- 2023Privacy in Large Language Models: Attacks, Defenses and Future Directionscited by 48
- 2024A Performance Study of LLM-Generated Code on Leetcodecited by 48
- 2023StudentEval: A Benchmark of Student-Written Prompts for Large Language Models of Codecited by 32
- 2023DeceptPrompt: Exploiting LLM-driven Code Generation via Adversarial Natural Language Instructionscited by 31
- 2024LiCoEval: Evaluating LLMs on License Compliance in Code Generationcited by 13
- 2024Black-Box Adversarial Attacks on LLM-Based Code Completioncited by 13
- 2025VeriLeaky: Navigating IP Protection vs Utility in Fine-Tuning for LLM-Driven Verilog Codingcited by 10
- 2024From Vulnerabilities to Remediation: A Systematic Literature Review of LLMs in Code Securitycited by 9
- 2025A Systematic Review of Poisoning Attacks Against Large Language Modelscited by 8
12 most cited of 26 All 26 (JSON)
- 2026Builder, Defender, Breaker: Measurable Independence and Bounded Autonomy When Generative Models Build, Defend and Test Software3 Jul 2026
- 2026Fixed-Set Robustness in Programming by Example: Example Corruption and Semantic Partition Recovery1 Jul 2026
- 2026Words Speak Louder Than Code: Investigating Cognitive Heuristics in LLM-Based Code Vulnerability Detection29 Jun 2026
- 2026Poison with Style: A Practical Poisoning Attack on Code Large Language Models26 May 2026
- 2026Security of LLM-generated Code: A Comparative Analysis21 May 2026
- 2025SoK: Understanding (New) Security Issues Across AI4Code Use Cases20 Dec 2025
- 2025Investigating Security Implications of Automatically Generated Code on the Software Supply Chain24 Sep 2025
- 2025A Systematic Evaluation of Parameter-Efficient Fine-Tuning Methods for the Security of Code LLMs16 Sep 2025
- 2025Scam2Prompt: A Scalable Framework for Auditing Malicious Scam Endpoints in Production LLMs2 Sep 2025
- 2025Trust Me, I Know This Function: Hijacking LLM Static Analysis using Bias24 Aug 2025
- 2025Large Language Models in Cybersecurity: Applications, Vulnerabilities, and Defense Techniques18 Jul 2025
- 2025A Systematic Review of Poisoning Attacks Against Large Language Models6 Jun 2025
12 newest of 26 All 26 (JSON)