mlsanityData to 7 Oct 2026

CleanBase: Detecting Malicious Documents in RAG Knowledge Databases

arXiv 2605.00460 ↗First posted 1 May 2026cs.CR cs.LGcited by 0

On the map: Retrieval-augmented generation → Privacy and security of RAG

also in 1 more
Abstract (arXiv)

Retrieval-augmented generation (RAG) is vulnerable to prompt injection attacks, in which an adversary inserts malicious documents containing carefully crafted injected prompts into the knowledge database. When a user issues a question targeted by the attack, the RAG system may retrieve these malicious documents, whose injected prompts mislead it into generating attacker-specified answers, thereby compromising the integrity of the RAG system. In this work, we propose CleanBase, a method to detect malicious documents within a knowledge database. Our key insight is that malicious documents crafted for the same attack-targeted questions often exhibit high semantic similarity, as attackers deliberately make them consistent to improve attack success rates. Accordingly, CleanBase constructs a similarity graph over the knowledge database, where each node represents a document and an edge connects two nodes if their semantic similarity--computed using an embedding model--exceeds a statistically determined threshold. Due to their inherent similarity, malicious documents tend to form cliques within this graph. CleanBase detects such cliques and flags the corresponding documents as malicious. We theoretically derive upper bounds on CleanBase's false positive and false negative rates and empirically validate its effectiveness. Experimental results across multiple datasets and prompt injection attacks demonstrate that CleanBase accurately detects malicious documents and effectively safeguards RAG systems. Our source code is available at https://github.com/WeifeiJin/CleanBase.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Placed in Privacy and security of RAG, one of 15 directions in Retrieval-augmented generation. Builds on 33 of its 46 references that are in the map. First posted on arXiv 1 May 2026.

Builds on

33 of 46 references.

Closest ancestors · 6

Same direction, newest first

  1. 2025ReliabilityRAG: Effective and Provably Robust Defense for RAG-based Web-Search27 Sep
  2. 2025Topic-FlipRAG: Topic-Orientated Adversarial Opinion Manipulation Attacks to Retrieval-Augmented Generation Models3 Feb
  3. 2024GASLITEing the Retrieval: Exploring Vulnerabilities in Dense Embedding-based Search30 Dec
  4. 2024Machine Against the RAG: Jamming Retrieval-Augmented Generation with Blocker Documents9 Jun
  5. 2024Certifiably Robust RAG against Retrieval Corruption24 May
  6. 2024PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Models12 Feb

Other references · 27

  1. 2024The Llama 3 Herd of Modelscited by 14,192
  2. 2023Llama 2: Open Foundation and Fine-Tuned Chat Modelscited by 12,865
  3. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
  4. 2025Qwen3 Technical Reportcited by 8,195
  5. 2024GPT-4o System Cardcited by 4,467
  6. 2020Dense Passage Retrieval for Open-Domain Question Answeringcited by 3,779
  7. 2018HotpotQA: A Dataset for Diverse, Explainable Multi-hop Question Answeringcited by 3,686
  8. 2025Gemini 2.5: Pushing the Frontier with Advanced Reasoning, Multimodality, Long Context, and Next Generation Agentic Capabilitiescited by 3,655
  9. 2018FEVER: a large-scale dataset for Fact Extraction and VERificationcited by 1,362
  10. 2023Not what you've signed up for: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injectioncited by 1,339
  11. 2021Improving language models by retrieving from trillions of tokenscited by 1,278
  12. 2021Unsupervised Dense Information Retrieval with Contrastive Learningcited by 1,203
15 more
  1. 2020Approximate Nearest Neighbor Negative Contrastive Learning for Dense Text Retrievalcited by 846
  2. 2022Ignore Previous Prompt: Attack Techniques For Language Modelscited by 760
  3. 2020Fact or Fiction: Verifying Scientific Claimscited by 546
  4. 2023Formalizing and Benchmarking Prompt Injection Attacks and Defensescited by 328
  5. 2023Poisoning Web-Scale Training Datasets is Practicalcited by 276
  6. 2020MiniLMv2: Multi-Head Self-Attention Relation Distillation for Compressing Pretrained Transformerscited by 240
  7. 2024SecAlign: Defending Against Prompt Injection with Preference Optimizationcited by 179
  8. 2025Prompt Injection Attack to Tool Selection in LLM Agentscited by 145
  9. 2025DataSentinel: A Game-Theoretic Detection of Prompt Injection Attackscited by 124
  10. 2024Optimization-based Prompt Injection Attack to LLM-as-a-Judgecited by 123
  11. 2024PLeak: Prompt Leaking Attacks against Large Language Model Applicationscited by 113
  12. 2025WebInject: Prompt Injection Attack to Web Agentscited by 48
  13. 2025A Critical Evaluation of Defenses against Prompt Injection Attackscited by 31
  14. 2018Graph-based Security and Privacy Analytics via Collective Classification with Joint Weight Learning and Propagationcited by 14
  15. 2013SybilBelief: A Semi-supervised Learning Approach for Structure-based Sybil Detectioncited by 11

Built on by

Not cited yet.

Similar, not cited

Close in wording, no citation either way

  1. 2025Secure Retrieval-Augmented Generation against Poisoning Attacks
  2. 2025UniC-RAG: Universal Knowledge Corruption Attacks to Retrieval-Augmented Generation
  3. 2025One Shot Dominance: Knowledge Poisoning Attack on Retrieval-Augmented Generation Systems
  4. 2025RAG Safety: Exploring Knowledge Poisoning Attacks to Retrieval-Augmented Generation
  5. 2026Benchmarking Knowledge-Extraction Attack and Defense on Retrieval-Augmented Generation
  6. 2025RAG Security and Privacy: Formalizing the Threat Model and Attack Surface
  7. 2025Token-Level Precise Attack on RAG: Searching for the Best Alternatives to Mislead Generation
  8. 2025Traceback of Poisoning Attacks to Retrieval-Augmented Generation