mlsanityData to 7 Oct 2026

TrojanPuzzle: Covertly Poisoning Code-Suggestion Models

arXiv 2301.02344 ↗First posted 6 Jan 2023cs.CR cs.LGcited by 47

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

  1. 2017Attention Is All You Needcited by 59,932
  2. 2018BERT: Pre-training of Deep Bidirectional Transformers for Language Understandingcited by 40,204
  3. 2020Language Models are Few-Shot Learnerscited by 32,199
  4. 2019Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformercited by 14,491
  5. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  6. 2021Program Synthesis with Large Language Modelscited by 3,509
  7. 2019The Curious Case of Neural Text Degenerationcited by 2,881
  8. 2020The Pile: An 800GB Dataset of Diverse Text for Language Modelingcited by 2,346
  9. 2020Extracting Training Data from Large Language Modelscited by 2,144
  10. 2022Competition-Level Code Generation with AlphaCodecited by 1,427
  11. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  12. 2017Targeted Backdoor Attacks on Deep Learning Systems Using Data Poisoningcited by 1,012
30 more
  1. 2018The Secret Sharer: Evaluating and Testing Unintended Memorization in Neural Networkscited by 847
  2. 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 732
  3. 2020Self-supervised Learning: Generative or Contrastivecited by 693
  4. 2018Fine-Pruning: Defending Against Backdooring Attacks on Deep Neural Networkscited by 550
  5. 2020Pre-trained Models for Natural Language Processing: A Surveycited by 504
  6. 2018Poison Frogs! Targeted Clean-Label Poisoning Attacks on Neural Networkscited by 500
  7. 2022InCoder: A Generative Model for Code Infilling and Synthesiscited by 492
  8. 2018Spectral Signatures in Backdoor Attackscited by 457
  9. 2018Detecting Backdoor Attacks on Deep Neural Networks by Activation Clusteringcited by 429
  10. 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 417
  11. 2019Hidden Trigger Backdoor Attackscited by 359
  12. 2021Pre-Trained Models: Past, Present and Futurecited by 319
  13. 2019A backdoor attack against LSTM-based text classification systemscited by 214
  14. 2021Hidden Killer: Invisible Textual Backdoor Attacks with Syntactic Triggercited by 203
  15. 2019Detecting AI Trojans Using Meta Neural Analysiscited by 192
  16. 2022Do Users Write More Insecure Code with AI Assistants?cited by 186
  17. 2020Witches' Brew: Industrial Scale Data Poisoning via Gradient Matchingcited by 156
  18. 2019Transferable Clean-Label Poisoning Attacks on Deep Neural Netscited by 129
  19. 2020Adversarial Machine Learning -- Industry Perspectivescited by 121
  20. 2020MetaPoison: Practical General-purpose Clean-label Data Poisoningcited by 114
  21. 2020You Autocomplete Me: Poisoning Vulnerabilities in Neural Code Completioncited by 112
  22. 2021Turn the Combination Lock: Learnable Textual Backdoor Attacks via Word Substitutioncited by 85
  23. 2020Trojaning Language Models for Fun and Profitcited by 80
  24. 2020Bullseye Polytope: A Scalable Clean-Label Poisoning Attack with Improved Transferabilitycited by 65
  25. 2021T-Miner: A Generative Approach to Defend Against Trojan Attacks on DNN-based Text Classificationcited by 56
  26. 2019Pythia: AI-assisted Code Completion Systemcited by 54
  27. 2020Poison Attacks against Text Datasets with Conditional Adversarially Regularized Autoencodercited by 27
  28. 2020BAAAN: Backdoor Attacks Against Autoencoder and GAN-Based Machine Learning Modelscited by 23
  29. 2017Automated Poisoning Attacks and Defenses in Malware Detection Systems: An Adversarial Machine Learning Approachcited by 18
  30. 2020VenoMave: Targeted Poisoning Against Speech Recognitioncited by 7

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2023: 7; 2024: 12; 2025: 16; 2026: 12.

47 papers.

Sort:

By area:

  1. 2023A Survey on Large Language Model (LLM) Security and Privacy: The Good, the Bad, and the Uglycited by 380
  2. 2024Security and Privacy Challenges of Large Language Models: A Surveycited by 179
  3. 2023Learning Performance-Improving Code Editscited by 103
  4. 2023A Survey of Safety and Trustworthiness of Large Language Models through the Lens of Verification and Validationcited by 91
  5. 2024Navigating the Risks: A Survey of Security, Privacy, and Ethics Threats in LLM-Based Agentscited by 63
  6. 2023Privacy in Large Language Models: Attacks, Defenses and Future Directionscited by 48
  7. 2024A Performance Study of LLM-Generated Code on Leetcodecited by 48
  8. 2023StudentEval: A Benchmark of Student-Written Prompts for Large Language Models of Codecited by 32
  9. 2024An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong Detectioncited by 32
  10. 2023DeceptPrompt: Exploiting LLM-driven Code Generation via Adversarial Natural Language Instructionscited by 31
  11. 2023Vulnerabilities in AI Code Generators: Exploring Targeted Data Poisoning Attackscited by 29
  12. 2024CleanGen: Mitigating Backdoor Attacks for Generation Tasks in Large Language Modelscited by 20
35 more
  1. 2025Don't Pass@k: A Bayesian Framework for Large Language Model Evaluationcited by 15
  2. 2024LiCoEval: Evaluating LLMs on License Compliance in Code Generationcited by 13
  3. 2024Black-Box Adversarial Attacks on LLM-Based Code Completioncited by 13
  4. 2024CLIBE: Detecting Dynamic Backdoors in Transformer-based NLP Modelscited by 11
  5. 2024Exploring Vulnerabilities and Protections in Large Language Models: A Surveycited by 10
  6. 2025VeriLeaky: Navigating IP Protection vs Utility in Fine-Tuning for LLM-Driven Verilog Codingcited by 10
  7. 2024From Vulnerabilities to Remediation: A Systematic Literature Review of LLMs in Code Securitycited by 9
  8. 2025RedCodeAgent: Automatic Red-teaming Agent against Diverse Code Agentscited by 9
  9. 2026A Systematic Survey of Security Threats and Defenses in LLM-Based AI Agents: A Layered Attack Surface Frameworkcited by 9
  10. 2025A Systematic Review of Poisoning Attacks Against Large Language Modelscited by 8
  11. 2025RedCoder: Automated Multi-Turn Red Teaming for Code LLMscited by 8
  12. 2025RAG-Pull: Turning Retrieval into a Code-Injection Channel via Invisible Unicode Perturbationscited by 4
  13. 2026Beware What You Autocomplete: Forensic Attribution of Backdoored Code Completionscited by 4
  14. 2025Trust Me, I Know This Function: Hijacking LLM Static Analysis using Biascited by 3
  15. 2025A First Look at the Security Issues in the Model Context Protocol Ecosystemcited by 3
  16. 2026"I'm Not Reading All of That": Understanding Software Engineers' Level of Cognitive Engagement with Agentic Coding Assistantscited by 3
  17. 2024Code Vulnerability Repair with Large Language Model using Context-Aware Prompt Tuningcited by 2
  18. 2025Scam2Prompt: A Scalable Framework for Auditing Malicious Scam Endpoints in Production LLMscited by 2
  19. 2025From Poisoned to Aware: Fostering Backdoor Self-Awareness in LLMscited by 2
  20. 2025CoTDeceptor:Adversarial Code Obfuscation Against CoT-Enhanced LLM Code Agentscited by 2
  21. 2024Trojans in Large Language Models of Code: A Critical Review through a Trigger-Based Taxonomycited by 1
  22. 2025Investigating Security Implications of Automatically Generated Code on the Software Supply Chaincited by 1
  23. 2026Poison with Style: A Practical Poisoning Attack on Code Large Language Modelscited by 1
  24. 2026SEVRA-BENCH: Social Engineering of Vulnerabilities in Review Agentscited by 1
  25. 2025Poisoned Source Code Detection in Code Modelscited by 0
  26. 2025Large Language Models in Cybersecurity: Applications, Vulnerabilities, and Defense Techniquescited by 0
  27. 2025A Systematic Evaluation of Parameter-Efficient Fine-Tuning Methods for the Security of Code LLMscited by 0
  28. 2025SoK: Understanding (New) Security Issues Across AI4Code Use Casescited by 0
  29. 2026Detecting Data Poisoning in Code Generation LLMs via Black-Box, Vulnerability-Oriented Scanningcited by 0
  30. 2026Security of LLM-generated Code: A Comparative Analysiscited by 0
  31. 2026A Red Teaming Framework for Large Language Models: A Case Study on Faithfulness Evaluationcited by 0
  32. 2026Words Speak Louder Than Code: Investigating Cognitive Heuristics in LLM-Based Code Vulnerability Detectioncited by 0
  33. 2026Fixed-Set Robustness in Programming by Example: Example Corruption and Semantic Partition Recoverycited by 0
  34. 2026Builder, Defender, Breaker: Measurable Independence and Bounded Autonomy When Generative Models Build, Defend and Test Softwarecited by 0
  35. 2026Reflections on Trusting Trust, Revisited: Contaminating Self-Modifying AI Coding Agents with Poisoned Benchmarkscited by 0