HijackRAG: Hijacking Attacks against Retrieval-Augmented Large Language Models
On the map: Retrieval-augmented generation → Privacy and security of RAG
Abstract (arXiv)
Retrieval-Augmented Generation (RAG) systems enhance large language models (LLMs) by integrating external knowledge, making them adaptable and cost-effective for various applications. However, the growing reliance on these systems also introduces potential security risks. In this work, we reveal a novel vulnerability, the retrieval prompt hijack attack (HijackRAG), which enables attackers to manipulate the retrieval mechanisms of RAG systems by injecting malicious texts into the knowledge database. When the RAG system encounters target questions, it generates the attacker's pre-determined answers instead of the correct ones, undermining the integrity and trustworthiness of the system. We formalize HijackRAG as an optimization problem and propose both black-box and white-box attack strategies tailored to different levels of the attacker's knowledge. Extensive experiments on multiple benchmark datasets show that HijackRAG consistently achieves high attack success rates, outperforming existing baseline attacks. Furthermore, we demonstrate that the attack is transferable across different retriever models, underscoring the widespread risk it poses to RAG systems. Lastly, our exploration of various defense mechanisms reveals that they are insufficient to counter HijackRAG, emphasizing the urgent need for more robust security measures to protect RAG systems in real-world deployments.
Key facts. Cited by 27 papers in the map (data through 7 Oct 2026). Placed in Privacy and security of RAG, one of 15 directions in Retrieval-augmented generation. Builds on 20 of its 32 references that are in the map. First posted on arXiv 30 Oct 2024.
Builds on
20 of 32 references.
References · 20
- 2023GPT-4 Technical Reportcited by 18,132
- 2024The Llama 3 Herd of Modelscited by 14,192
- 2023LLaMA: Open and Efficient Foundation Language Modelscited by 13,958
- 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
- 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
- 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,686
- 2020REALM: Retrieval-Augmented Language Model Pre-Trainingcited by 2,126
- 2019Language Models as Knowledge Bases?cited by 1,922
- 2016MS MARCO: A Human Generated MAchine Reading COmprehension Datasetcited by 1,591
- 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injectioncited by 1,339
- 2024ChatGLM: A Family of Large Language Models from GLM-130B to GLM-4 All Toolscited by 1,096
- 2022Interleaving Retrieval with Chain-of-Thought Reasoning for Knowledge-Intensive Multi-Step Questionscited by 911
8 more
- 2020Approximate Nearest Neighbor Negative Contrastive Learning for Dense Text Retrievalcited by 846
- 2022Ignore Previous Prompt: Attack Techniques For Language Modelscited by 760
- 2020How Much Knowledge Can You Pack Into the Parameters of a Language Model?cited by 713
- 2023Baseline Defenses for Adversarial Attacks Against Aligned Language Modelscited by 608
- 2023Check Your Facts and Try Again: Improving Large Language Models with External Knowledge and Automated Feedbackcited by 351
- 2023Fine-Tuning or Retrieval? Comparing Knowledge Injection in LLMscited by 175
- 2022DocPrompting: Generating Code by Retrieving the Docscited by 151
- 2023RECALL: A Benchmark for LLMs Robustness against External Counterfactual Knowledgecited by 51
Built on by
Citing papers per year: 2025: 16; 2026: 11.
27 papers.
Sort:
By area:
- 2025Advances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systemscited by 125
- 2025Topic-FlipRAG: Topic-Orientated Adversarial Opinion Manipulation Attacks to Retrieval-Augmented Generation Modelscited by 32
- 2026The Landscape of Prompt Injection Threats in LLM Agents: From Taxonomy to Analysiscited by 25
- 2025Retrieval Augmented Generation Evaluation in the Era of Large Language Models: A Comprehensive Surveycited by 20
- 2025Benchmarking Poisoning Attacks against Retrieval-Augmented Generationcited by 17
- 2026Overcoming the Retrieval Barrier: Indirect Prompt Injection in the Wild for LLM Systemscited by 16
- 2025Who Taught the Lie? Responsibility Attribution for Poisoned Knowledge in Retrieval-Augmented Generationcited by 12
- 2025Exploring the Security Threats of Knowledge Base Poisoning in Retrieval-Augmented Code Generationcited by 9
- 2026A Systematic Survey of Security Threats and Defenses in LLM-Based AI Agents: A Layered Attack Surface Frameworkcited by 9
- 2026SoK: Privacy Risks and Mitigations in Retrieval-Augmented Generation Systemscited by 7
- 2025POISONCRAFT: Practical Poisoning of Retrieval-Augmented Generation for Large Language Modelscited by 6
- 2025Chain-of-Thought Poisoning Attacks against R1-based Retrieval-Augmented Generation Systemscited by 5
15 more
- 2025Evaluating the Robustness of Retrieval-Augmented Generation to Adversarial Evidence in the Health Domaincited by 5
- 2025Red-Teaming Coding Agents from a Tool-Invocation Perspective: An Empirical Security Assessmentcited by 4
- 2025RAG-Pull: Turning Retrieval into a Code-Injection Channel via Invisible Unicode Perturbationscited by 4
- 2025MIRAGE: Misleading Retrieval-Augmented Generation via Black-box and Query-agnostic Poisoning Attackscited by 4
- 2025Securing RAG: A Risk Assessment and Mitigation Frameworkcited by 3
- 2025EmoRAG: Evaluating RAG Robustness to Symbolic Perturbationscited by 3
- 2026DRAINCODE: Stealthy Energy Consumption Attacks on Retrieval-Augmented Code Generation via Context Poisoningcited by 3
- 2026Towards Secure Retrieval-Augmented Generation: A Comprehensive Review of Threats, Defenses and Benchmarkscited by 3
- 2026AdversarialCoT: Single-Document Retrieval Poisoning for LLM Reasoningcited by 3
- 2025Eyes-on-Me: Scalable RAG Poisoning through Transferable Attention-Steering Attractorscited by 1
- 2026Knowledge Base Poisoning Attacks and Defense for Policy-Aware LLM-RAG Frameworkcited by 1
- 2025Provably Secure Retrieval-Augmented Generationcited by 0
- 2026BiRD: A Bidirectional Ranking Defense Mechanism for Retrieval Augmented Generationcited by 0
- 2026TriShieldRAG: 3 Rings, One Blind Spot in Layered Defenses for Retrieval-Augmented Generationcited by 0
- 2026InceptionRAG: Stealthy Poisoning Attack Against Retrieval-Augmented Generationcited by 0
- 2026InceptionRAG: Stealthy Poisoning Attack Against Retrieval-Augmented Generation15 Sep 2026
- 2026TriShieldRAG: 3 Rings, One Blind Spot in Layered Defenses for Retrieval-Augmented Generation26 Jul 2026
- 2026Knowledge Base Poisoning Attacks and Defense for Policy-Aware LLM-RAG Framework5 Jul 2026
- 2026BiRD: A Bidirectional Ranking Defense Mechanism for Retrieval Augmented Generation19 May 2026
- 2026A Systematic Survey of Security Threats and Defenses in LLM-Based AI Agents: A Layered Attack Surface Framework25 Apr 2026
- 2026AdversarialCoT: Single-Document Retrieval Poisoning for LLM Reasoning14 Apr 2026
- 2026Towards Secure Retrieval-Augmented Generation: A Comprehensive Review of Threats, Defenses and Benchmarks23 Mar 2026
- 2026The Landscape of Prompt Injection Threats in LLM Agents: From Taxonomy to Analysis11 Feb 2026
- 2026DRAINCODE: Stealthy Energy Consumption Attacks on Retrieval-Augmented Code Generation via Context Poisoning28 Jan 2026
- 2026Overcoming the Retrieval Barrier: Indirect Prompt Injection in the Wild for LLM Systems11 Jan 2026
- 2026SoK: Privacy Risks and Mitigations in Retrieval-Augmented Generation Systems7 Jan 2026
- 2025MIRAGE: Misleading Retrieval-Augmented Generation via Black-box and Query-agnostic Poisoning Attacks9 Dec 2025
15 more
- 2025EmoRAG: Evaluating RAG Robustness to Symbolic Perturbations1 Dec 2025
- 2025RAG-Pull: Turning Retrieval into a Code-Injection Channel via Invisible Unicode Perturbations13 Oct 2025
- 2025Eyes-on-Me: Scalable RAG Poisoning through Transferable Attention-Steering Attractors1 Oct 2025
- 2025Who Taught the Lie? Responsibility Attribution for Poisoned Knowledge in Retrieval-Augmented Generation17 Sep 2025
- 2025Red-Teaming Coding Agents from a Tool-Invocation Perspective: An Empirical Security Assessment6 Sep 2025
- 2025Evaluating the Robustness of Retrieval-Augmented Generation to Adversarial Evidence in the Health Domain4 Sep 2025
- 2025Provably Secure Retrieval-Augmented Generation1 Aug 2025
- 2025Benchmarking Poisoning Attacks against Retrieval-Augmented Generation24 May 2025
- 2025Chain-of-Thought Poisoning Attacks against R1-based Retrieval-Augmented Generation Systems22 May 2025
- 2025Securing RAG: A Risk Assessment and Mitigation Framework13 May 2025
- 2025POISONCRAFT: Practical Poisoning of Retrieval-Augmented Generation for Large Language Models10 May 2025
- 2025Retrieval Augmented Generation Evaluation in the Era of Large Language Models: A Comprehensive Survey21 Apr 2025
- 2025Advances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systems31 Mar 2025
- 2025Exploring the Security Threats of Knowledge Base Poisoning in Retrieval-Augmented Code Generation5 Feb 2025
- 2025Topic-FlipRAG: Topic-Orientated Adversarial Opinion Manipulation Attacks to Retrieval-Augmented Generation Models3 Feb 2025
- 2025Topic-FlipRAG: Topic-Orientated Adversarial Opinion Manipulation Attacks to Retrieval-Augmented Generation Modelscited by 32
- 2025Retrieval Augmented Generation Evaluation in the Era of Large Language Models: A Comprehensive Surveycited by 20
- 2025Benchmarking Poisoning Attacks against Retrieval-Augmented Generationcited by 17
- 2025Who Taught the Lie? Responsibility Attribution for Poisoned Knowledge in Retrieval-Augmented Generationcited by 12
- 2025Exploring the Security Threats of Knowledge Base Poisoning in Retrieval-Augmented Code Generationcited by 9
- 2026SoK: Privacy Risks and Mitigations in Retrieval-Augmented Generation Systemscited by 7
- 2025POISONCRAFT: Practical Poisoning of Retrieval-Augmented Generation for Large Language Modelscited by 6
- 2025Evaluating the Robustness of Retrieval-Augmented Generation to Adversarial Evidence in the Health Domaincited by 5
- 2025RAG-Pull: Turning Retrieval into a Code-Injection Channel via Invisible Unicode Perturbationscited by 4
- 2025MIRAGE: Misleading Retrieval-Augmented Generation via Black-box and Query-agnostic Poisoning Attackscited by 4
- 2025Securing RAG: A Risk Assessment and Mitigation Frameworkcited by 3
- 2025EmoRAG: Evaluating RAG Robustness to Symbolic Perturbationscited by 3
12 most cited of 20 All 20 (JSON)
- 2026InceptionRAG: Stealthy Poisoning Attack Against Retrieval-Augmented Generation15 Sep 2026
- 2026TriShieldRAG: 3 Rings, One Blind Spot in Layered Defenses for Retrieval-Augmented Generation26 Jul 2026
- 2026Knowledge Base Poisoning Attacks and Defense for Policy-Aware LLM-RAG Framework5 Jul 2026
- 2026BiRD: A Bidirectional Ranking Defense Mechanism for Retrieval Augmented Generation19 May 2026
- 2026Towards Secure Retrieval-Augmented Generation: A Comprehensive Review of Threats, Defenses and Benchmarks23 Mar 2026
- 2026DRAINCODE: Stealthy Energy Consumption Attacks on Retrieval-Augmented Code Generation via Context Poisoning28 Jan 2026
- 2026SoK: Privacy Risks and Mitigations in Retrieval-Augmented Generation Systems7 Jan 2026
- 2025MIRAGE: Misleading Retrieval-Augmented Generation via Black-box and Query-agnostic Poisoning Attacks9 Dec 2025
- 2025EmoRAG: Evaluating RAG Robustness to Symbolic Perturbations1 Dec 2025
- 2025RAG-Pull: Turning Retrieval into a Code-Injection Channel via Invisible Unicode Perturbations13 Oct 2025
- 2025Eyes-on-Me: Scalable RAG Poisoning through Transferable Attention-Steering Attractors1 Oct 2025
- 2025Who Taught the Lie? Responsibility Attribution for Poisoned Knowledge in Retrieval-Augmented Generation17 Sep 2025
12 newest of 20 All 20 (JSON)
- 2025Advances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systemscited by 125
- 2026The Landscape of Prompt Injection Threats in LLM Agents: From Taxonomy to Analysiscited by 25
- 2026A Systematic Survey of Security Threats and Defenses in LLM-Based AI Agents: A Layered Attack Surface Frameworkcited by 9
- 2025Red-Teaming Coding Agents from a Tool-Invocation Perspective: An Empirical Security Assessmentcited by 4
- 2026A Systematic Survey of Security Threats and Defenses in LLM-Based AI Agents: A Layered Attack Surface Framework25 Apr 2026
- 2026The Landscape of Prompt Injection Threats in LLM Agents: From Taxonomy to Analysis11 Feb 2026
- 2025Red-Teaming Coding Agents from a Tool-Invocation Perspective: An Empirical Security Assessment6 Sep 2025
- 2025Advances and Challenges in Foundation Agents: From Brain-Inspired Intelligence to Evolutionary, Collaborative, and Safe Systems31 Mar 2025
Similar, not cited
Close in wording, no citation either way
- 2025Token-Level Precise Attack on RAG: Searching for the Best Alternatives to Mislead Generation
- 2024PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Models
- 2025PR-Attack: Coordinated Prompt-RAG Attacks on Retrieval-Augmented Generation in Large Language Models via Bilevel Optimization
- 2024Backdoored Retrievers for Prompt Injection Attacks on Retrieval Augmented Generation of Large Language Models
- 2026Securing Retrieval-Augmented Generation: A Taxonomy of Attacks, Defenses, and Future Directions
- 2025Practical Poisoning Attacks against Retrieval-Augmented Generation
- 2026Retrieved But Not Reliable: A Survey on Attacks, and Defenses in Retrieval-Augmented Generation
- 2025One Shot Dominance: Knowledge Poisoning Attack on Retrieval-Augmented Generation Systems