Abstract
Retrieval-Augmented Generation (RAG) is widely used to enhance Large Language Models (LLMs) with external knowledge. However, this paper introduces CorruptRAG, a novel "single-shot" poisoning attack that demonstrates how RAG systems can be compromised by injecting just one malicious document. By exploiting the inherent recency biases of LLMs, CorruptRAG achieves near-perfect attack success rates with minimal cost and high stealth, bypassing traditional anomaly detection and common defensive strategies.
Introduction: The Fragility of RAG
Retrieval-Augmented Generation (RAG) has become the industry standard for reducing LLM hallucinations by allowing models to reference a trusted external database. While effective, this architecture introduces a significant "poisoning" attack surface. Previous research, such as PoisonedRAG, suggested that attackers needed to flood a database with dozens of malicious documents to outnumber correct information and subvert the model's output. Such "flooding" attacks are expensive, difficult to coordinate, and easily flagged by anomaly detection systems.
This research proves that RAG systems are far more fragile than previously assumed. An attacker does not need a crowd of lies to subvert the truth; they only need one well-crafted "alternative fact."
Methodology: CorruptRAG
The authors frame the attack as a dual-criterion optimization problem:
- Retrieval (Criterion I): The poisoned text must be relevant enough to be selected by the retriever (e.g., appearing in the Top-5 or Top-10 results).
- Generation (Criterion II): Once retrieved, the text must be persuasive enough to compel the LLM to ignore other correct documents and output the attacker's target answer.
To address these, two variants of CorruptRAG were developed:
- CorruptRAG-AS (Adversarial Strategy): A template-based approach. It uses the target query as a prefix to ensure retrieval and employs a "recency" trick—explicitly stating that existing data is "outdated" and the attacker's lie is the "latest confirmed data"—to manipulate the LLM's generation.
- CorruptRAG-AK (Adversarial Knowledge): This version uses an LLM (e.g., GPT-4o-mini) to refine the template into a cohesive, natural-sounding piece of knowledge. This increases generalizability and makes the text harder for automated filters to detect.
Experimental Setup
The attacks were evaluated on three massive, standard benchmarks:
- Natural Questions (NQ): Real Google search queries paired with Wikipedia data.
- HotpotQA: Multi-hop reasoning tasks over Wikipedia.
- MS-MARCO: Large-scale web documents sourced from Bing.
Key Results and Insights
CorruptRAG significantly outperformed existing baselines across all datasets and models, including GPT-3.5, GPT-4o, and GPT-4-turbo.
Attack Success Rate (ASR) and Robustness
While previous single-document attacks struggled to maintain efficacy as more documents were retrieved, CorruptRAG maintained an ASR frequently exceeding 90%. Notably, on the NQ dataset using GPT-4o-mini, CorruptRAG-AS achieved a 97% success rate. As shown in the performance graphs, the attack remains highly effective even when the retrieval window ($N$) is increased from 5 to 30 documents, whereas baseline attacks like PoisonedRAG see a sharp decline in performance.
The "Recency Bias" Exploit
The critical insight of this work is the exploitation of "Recency Bias." LLMs are trained to prioritize the most current information. By framing the truth as "outdated" and the malicious injection as "recent," the attacker bypasses both the model's internal knowledge and other retrieved correct documents.
Stealth and Cost-Efficiency
By restricting the attack to a single document, CorruptRAG is nearly impossible to detect using statistical anomaly detection. In tests of LLM-based poisoning detection, CorruptRAG had a detection rate of less than 10%, while older prompt-injection style attacks were caught over 80% of the time. Furthermore, the attack is extremely low-cost: CorruptRAG-AS is free to implement, and the refined AK version costs approximately $0.0001 per query.
Conclusion
The study demonstrates that current RAG defenses—such as query paraphrasing, instructional prevention, and LLM-based detection—largely fail against sophisticated single-shot attacks. Future work is required to address the vulnerabilities of RAG in open-ended queries and multi-modal environments (images/video), where the "single-shot" landscape is expected to evolve further.
Summary updated