mlsanityData to 14 Oct 2026

Detecting Data Poisoning in Code Generation LLMs via Black-Box, Vulnerability-Oriented Scanning

arXiv 2603.17174 ↗First posted 17 Mar 2026cs.CR cs.AI cs.SEcited by 0

On the map: LLM safety and security → Jailbreaking

Abstract (arXiv)

Code generation large language models (LLMs) are increasingly integrated into modern software development workflows. Recent work has shown that these models are vulnerable to backdoor and poisoning attacks that induce the generation of insecure code, yet effective defenses remain limited. Existing scanning approaches rely on token-level generation consistency to invert attack targets, which is ineffective for source code where identical semantics can appear in diverse syntactic forms. We present CodeScan, the first black-box, vulnerability-specific scanning framework for auditing code generation LLMs, assuming that the defender specifies the target vulnerability classes and provides corresponding task-relevant prompts. CodeScan identifies attack targets by analyzing structural similarities across multiple generations conditioned on different clean prompts. It combines iterative divergence analysis with abstract syntax tree (AST)-based normalization to abstract away surface-level variation and unify semantically equivalent code, isolating structures that recur consistently across generations. CodeScan then applies LLM-based vulnerability analysis to determine whether the extracted structures contain security vulnerabilities and flags the model as compromised when such a structure is found. We evaluate CodeScan against four representative attacks under both backdoor and poisoning settings across three real-world vulnerability classes. Experiments on 117 models spanning three architectures and multiple model sizes demonstrate 97%+ detection accuracy with substantially lower false positives than prior methods.

Key facts. No citing papers in the map yet (data through 14 Oct 2026). Placed in Jailbreaking, one of 12 directions in LLM safety and security. Builds on 43 of its 69 references that are in the map. First posted on arXiv 17 Mar 2026.

Builds on

43 of 69 references.

Closest ancestors · 1

Same direction, newest first

  1. 2023Universal and Transferable Adversarial Attacks on Aligned Language Models27 Jul

Other references · 42

  1. 2020Language Models are Few-Shot Learnerscited by 32,419
  2. 2023GPT-4 Technical Reportcited by 18,396
  3. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 13,028
  4. 2019The Curious Case of Neural Text Degenerationcited by 2,916
  5. 2023Code Llama: Open Foundation Models for Codecited by 2,139
  6. 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injectioncited by 1,443
  7. 2024Qwen2.5-Coder Technical Reportcited by 1,203
  8. 2022CodeGen: An Open Large Language Model for Code with Multi-Turn Program Synthesiscited by 885
  9. 2019Universal Adversarial Triggers for Attacking and Analyzing NLPcited by 722
  10. 2024Sleeper Agents: Training Deceptive LLMs that Persist Through Safety Trainingcited by 529
  11. 2024StarCoder 2 and The Stack v2: The Next Generationcited by 502
  12. 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 431
30 more
  1. 2019Hidden Trigger Backdoor Attackscited by 371
  2. 2022The Stack: 3 TB of permissively licensed source codecited by 359
  3. 2020Reflection Backdoor: A Natural Backdoor Attack on Deep Neural Networkscited by 349
  4. 2023Hard Prompts Made Easy: Gradient-Based Discrete Optimization for Prompt Tuning and Discoverycited by 336
  5. 2023Poisoning Web-Scale Training Datasets is Practicalcited by 290
  6. 2021Gradient-based Adversarial Attacks against Text Transformerscited by 234
  7. 2017A Survey of Machine Learning for Big Code and Naturalnesscited by 221
  8. 2020BadNL: Backdoor Attacks against NLP Models with Semantic-preserving Improvementscited by 211
  9. 2020Clean-Label Backdoor Attacks on Video Recognition Modelscited by 169
  10. 2023Backdooring Instruction-Tuned Large Language Models with Virtual Prompt Injectioncited by 157
  11. 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 139
  12. 2020You Autocomplete Me: Poisoning Vulnerabilities in Neural Code Completioncited by 131
  13. 2024IRIS: LLM-Assisted Static Analysis for Detecting Security Vulnerabilitiescited by 103
  14. 2024BadEdit: Backdooring large language models by model editingcited by 96
  15. 2022Wild Patterns Reloaded: A Survey of Machine Learning Security against Training Data Poisoningcited by 94
  16. 2021BadPre: Task-agnostic Backdoor Attacks to Pre-trained NLP Foundation Modelscited by 85
  17. 2024BadChain: Backdoor Chain-of-Thought Prompting for Large Language Modelscited by 80
  18. 2023Composite Backdoor Attacks Against Large Language Modelscited by 73
  19. 2025Poisoning Attacks on LLMs Require a Near-constant Number of Poison Samplescited by 72
  20. 2023TrojanPuzzle: Covertly Poisoning Code-Suggestion Modelscited by 60
  21. 2023Detecting Backdoors in Pre-trained Encoderscited by 55
  22. 2022Constrained Optimization with Dynamic Bound-scaling for Effective NLPBackdoor Defensecited by 47
  23. 2022BadDet: Backdoor Attacks on Object Detectioncited by 45
  24. 2024Large Language Model for Vulnerability Detection and Repair: Literature Review and the Road Aheadcited by 42
  25. 2024An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong Detectioncited by 40
  26. 2023Security Weaknesses of Copilot-Generated Code in GitHub Projects: An Empirical Studycited by 38
  27. 2024Assessing LLMs in Malicious Code Deobfuscation of Real-world Malware Campaignscited by 19
  28. 2025JsDeObsBench: Measuring and Benchmarking LLMs for JavaScript Deobfuscationcited by 7
  29. 2025A Systematic Study of Code Obfuscation Against LLM-based Vulnerability Detectioncited by 5
  30. 2025A Preliminary Study of Large Language Models for Multilingual Vulnerability Detectioncited by 2

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2025A Mixture of Linear Corrections Generates Secure Code
  2. 2025Rethinking the Evaluation of Secure Code Generation
  3. 2024From Vulnerabilities to Remediation: A Systematic Literature Review of LLMs in Code Security
  4. 2026CodePoisonRAG: Knowledge Poisoning Attacks on Retrieval-Augmented Code Generation
  5. 2025Automated Vulnerability Validation and Verification: A Large Language Model Approach
  6. 2026Bridging Code Property Graphs and Language Models for Program Analysis ↗
  7. 2025Smoke and Mirrors: Jailbreaking LLM-based Code Generation via Implicit Malicious Prompts
  8. 2025Exploring the Security Threats of Knowledge Base Poisoning in Retrieval-Augmented Code Generation