XOXO: Stealthy Cross-Origin Context Poisoning Attacks against AI Coding Assistants
Not on the map. Why?
Abstract (arXiv)
AI coding assistants are widely used for tasks like code generation. These tools now require large and complex contexts, automatically sourced from various originsunicodex2014across files, projects, and contributorsunicodex2014forming part of the prompt fed to underlying LLMs. This automatic context-gathering introduces new vulnerabilities, allowing attackers to subtly poison input to compromise the assistant's outputs, potentially generating vulnerable code or introducing critical errors. We propose a novel attack, Cross-Origin Context Poisoning (XOXO), that is challenging to detect as it relies on adversarial code modifications that are semantically equivalent. Traditional program analysis techniques struggle to identify these perturbations since the semantics of the code remains correct, making it appear legitimate. This allows attackers to manipulate coding assistants into producing incorrect outputs, while shifting the blame to the victim developer. We introduce a novel, task-agnostic, black-box attack algorithm GCGS that systematically searches the transformation space using a Cayley Graph, achieving a 75.72% attack success rate on average across five tasks and eleven models, including GPT 4.1 and Claude 3.5 Sonnet v2 used by popular AI coding assistants. Furthermore, defenses like adversarial fine-tuning are ineffective against our attack, underscoring the need for new security measures in LLM-powered coding tools.
Key facts. Cited by 4 papers in the map (data through 14 Oct 2026). Builds on 53 of its 112 references that are in the map. First posted on arXiv 18 Mar 2025.
Builds on
53 of 112 references.
References · 53
- 2023GPT-4 Technical Reportcited by 18,396
- 2024The Llama 3 Herd of Modelscited by 14,715
- 2021Evaluating Large Language Models Trained on Codecited by 8,320
- 2023Efficient Memory Management for Large Language Model Serving with PagedAttentioncited by 5,944
- 2024GPT-4o System Cardcited by 4,588
- 2021Program Synthesis with Large Language Modelscited by 3,637
- 2023Qwen Technical Reportcited by 3,344
- 2024Gemini 1.5: Unlocking multimodal understanding across millions of tokens of contextcited by 3,224
- 2023Code Llama: Open Foundation Models for Codecited by 2,139
- 2024Qwen2 Technical Reportcited by 2,120
- 2022Language Models (Mostly) Know What They Knowcited by 1,856
- 2023Is Your Code Generated by ChatGPT Really Correct? Rigorous Evaluation of Large Language Models for Code Generationcited by 1,391
38 more
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2024Qwen2.5-Coder Technical Reportcited by 1,203
- 2024DeepSeek-Coder: When the Large Language Model Meets Programming -- The Rise of Code Intelligencecited by 1,181
- 2023Can LLMs Express Their Uncertainty? An Empirical Evaluation of Confidence Elicitation in LLMscited by 974
- 2022Ignore Previous Prompt: Attack Techniques For Language Modelscited by 832
- 2021CodeXGLUE: A Machine Learning Benchmark Dataset for Code Understanding and Generationcited by 744
- 2019CodeSearchNet Challenge: Evaluating the State of Semantic Code Searchcited by 654
- 2020GraphCodeBERT: Pre-training Code Representations with Data Flowcited by 609
- 2020CodeBLEU: a Method for Automatic Evaluation of Code Synthesiscited by 479
- 2022DS-1000: A Natural and Reliable Benchmark for Data Science Code Generationcited by 452
- 2023CodeT5+: Open Code Large Language Models for Code Understanding and Generationcited by 333
- 2019Devign: Effective Vulnerability Identification by Learning Comprehensive Program Semantics via Graph Neural Networkscited by 272
- 2024AutoDAN-Turbo: A Lifelong Agent for Strategy Self-Exploration to Jailbreak LLMscited by 199
- 2022Do Users Write More Insecure Code with AI Assistants?cited by 192
- 2024Vulnerability Detection with Code Language Models: How Far Are We?cited by 139
- 2022ReCode: Robustness Evaluation of Code Generation Modelscited by 103
- 2024IRIS: LLM-Assisted Static Analysis for Detecting Security Vulnerabilitiescited by 103
- 2023LLMs Cannot Reliably Identify and Reason About Security Vulnerabilities (Yet?): A Comprehensive Evaluation, Framework, and Benchmarkscited by 97
- 2022Natural Attack for Pre-trained Models of Codecited by 75
- 2020Detecting Code Clones with Graph Neural Networkand Flow-Augmented Abstract Syntax Treecited by 69
- 2019Adversarial Examples for Models of Codecited by 63
- 2021A Survey On Universal Adversarial Attackcited by 59
- 2025CWEval: Outcome-driven Evaluation on Functionality and Security of LLM Code Generationcited by 59
- 2022CodeAttack: Code-Based Adversarial Attacks for Pre-trained Programming Language Modelscited by 53
- 2020Semantic Robustness of Models of Source Codecited by 45
- 2020On the Generalizability of Neural Program Models with respect to Semantic-Preserving Program Transformationscited by 44
- 2024A Survey on Evaluating Large Language Models in Code Generation Taskscited by 44
- 2020Adversarial Robustness for Codecited by 38
- 2024RepoQA: Evaluating Long Context Code Understandingcited by 35
- 2023DeceptPrompt: Exploiting LLM-driven Code Generation via Adversarial Natural Language Instructionscited by 33
- 2021Generating Adversarial Computer Programs using Optimized Obfuscationscited by 22
- 2021Adversarial Robustness of Deep Code Comment Generationcited by 22
- 2024The Counterfeit Conundrum: Can Code Language Models Grasp the Nuances of Their Incorrect Generations?cited by 20
- 2017On the Limitation of Convolutional Neural Networks in Recognizing Negative Imagescited by 17
- 2022Detecting False Alarms from Automatic Static Analysis Tools: How Far are We?cited by 17
- 2022RoPGen: Towards Robust Code Authorship Attribution via Automatic Coding Style Transformationcited by 15
- 2024Black-Box Adversarial Attacks on LLM-Based Code Completioncited by 14
- 2023Code Difference Guided Adversarial Example Generation for Deep Code Modelscited by 9
50 most cited of 53 All 53 (JSON)
Built on by
Citing papers per year: 2025: 3; 2026: 1.
4 papers.
- 2026Prompt Injection Attacks on Agentic Coding Assistants: A Systematic Analysis of Vulnerabilities in Skills, Tools, and Protocol Ecosystemscited by 31
- 2025Prompt Injection 2.0: Hybrid AI Threatscited by 13
- 2025AdvSumm: Adversarial Training for Bias Mitigation in Text Summarizationcited by 2
- 2025TrajSyn: Privacy-Preserving Dataset Distillation from Federated Model Trajectories for Server-Side Adversarial Trainingcited by 0
- 2026Prompt Injection Attacks on Agentic Coding Assistants: A Systematic Analysis of Vulnerabilities in Skills, Tools, and Protocol Ecosystems24 Jan 2026
- 2025TrajSyn: Privacy-Preserving Dataset Distillation from Federated Model Trajectories for Server-Side Adversarial Training17 Dec 2025
- 2025Prompt Injection 2.0: Hybrid AI Threats17 Jul 2025
- 2025AdvSumm: Adversarial Training for Bias Mitigation in Text Summarization6 Jun 2025