The RAG Paradox: A Black-Box Attack Exploiting Unintentional Vulnerabilities in Retrieval-Augmented Generation Systems

Chanwoo Choi, Jinsoo Kim, Sukmin Cho, Soyeong Jeong, Buru Chang

TL;DR

Retrieval-Augmented Generation (RAG) systems try to build user trust by displaying their search sources and retrieved documents. However, this paper exposes the "RAG Paradox": this very transparency allows black-box attackers to reverse-engineer a retriever's preferences, craft highly natural-looking poisoned documents, and inject them into public sources to manipulate LLM responses.

What Problem Does This Paper Address?

Most existing adversarial attacks on RAG systems operate under an unrealistic assumption: that the attacker has "white-box" or "gray-box" access to the system's internal components, such as retriever gradients or embedding outputs. In reality, commercial systems like ChatGPT or Perplexity keep these components strictly under wraps.

Furthermore, previous black-box attempts usually rely on brute-force tactics like "query prepending"—spamming the user's exact query terms at the top of a document to force the retriever to grab it. While effective at tricking the algorithm, this results in bizarre, gibberish-heavy text. Because modern RAG interfaces show the retrieved text directly to the user as a citation, highly unnatural documents immediately trigger suspicion.

This paper addresses this dual challenge: How can an external attacker successfully execute a black-box corpus poisoning attack without internal system access, while ensuring the poisoned documents look completely natural and credible to human eyes?

Methods

The authors introduce PARADOX (Preference Analysis of Retriever for Adaptive Document Optimization and eXploitation), a fully automated black-box attack framework.

Figure 2: An overview of the new black-box RAG attack scenario based on the RAG Paradox. Our study exploits external resources disclosed by RAG systems to launch attacks without relying on insider information.

The attack pipeline operates in three main phases using a helper LLM (Llama-3.1-8B-Instruct):

  1. Query Decomposition: The attacker LLM breaks down a target user query into core, meaning-bearing semantic components and annotates their intent.
  2. Retrieval Rationale Inference: By querying the target RAG system and observing the naturally returned documents, the attacker LLM analyzes how these semantic components are reflected in highly ranked results. This allows the attacker to map out the retriever's implicit phrasing preferences without knowing its underlying architecture.
  3. Document Generation: The LLM synthesizes a poisoned document that fluidly integrates the retriever's preferred linguistic structures and query terms to maximize retrievability. Crucially, the document presents a plausible but incorrect answer as fact while explicitly refuting the true answer as "outdated" or "mistaken."

Finally, the attacker uploads these natural-looking documents to open external platforms (like Wikipedia, Reddit, or LinkedIn) that the target RAG system routinely indexes.

Datasets

The authors evaluated their approach offline using three widely recognized question-answering benchmarks:

  • Natural Questions (NQ): A general-domain dataset based on real Google search queries.
  • HotpotQA: A diverse, multi-hop reasoning dataset based on Wikipedia.
  • MedQA: A specialized medical-domain dataset derived from professional medical board exams, used to test the attack's efficacy in highly technical contexts.

Key Insights and Ideas

  • The Transparency Dilemma: The core "aha!" moment is that security and transparency are in direct conflict here. Providing citations to verify claims gives attackers a clean, open feedback loop to optimize their adversarial payloads.
  • Retriever Preference Alignment: Instead of forcing a document into the retriever's view via keyword stuffing, PARADOX mimics the stylistic and structural "biases" of the retriever.
  • Psychological Deception: The generated documents don't just inject a false answer; they actively gaslight the reader (and the generator LLM) by framing the correct answer as an obsolete misconception (e.g., "Recent revisions to clinical guidelines now confirm...").

Key Results

The authors tested PARADOX against multiple retrievers (BM25, Contriever, ANCE, BGE) and generator LLMs (including GPT-4o and Llama-3).

  • Performance Degradation: Across the board, PARADOX caused massive drops in RAG accuracy. For example, on the NQ dataset using GPT-4o, system accuracy plummeted from a clean baseline of ~48–57% down to just ~15–16%.
  • Naturalness Evaluation Score (NES): Evaluated by GPT-4 on a scale of 1 to 5, PARADOX achieved near-perfect naturalness scores (~4.78 to 4.91), vastly outperforming baselines like Vec2Text (~1.08 to 2.48) and HotFlip (~1.23 to 2.22), which frequently produced broken sentences.
  • Real-World Feasibility: In a live pilot study, the authors successfully created a fake profile for a fictional person ("Vyrelin Drosamir") on LinkedIn and Wikipedia. Both ChatGPT and Perplexity subsequently scraped this fake data and served it up as factual evidence in user queries.

Limitations and Future Work

While highly effective, the authors note several limitations:

  • Naive RAG Frameworks: The offline evaluations were conducted on standard RAG pipelines. Future work needs to test how well this attack bypasses complex, production-grade guardrails and advanced multi-stage filtering.
  • LLM Evaluator Subjectivity: The Naturalness Evaluation Score (NES) relies on an LLM-as-a-judge approach, which introduces inherent subjectivity.
  • Domain Uniformity: The criteria for detecting artificial text were applied uniformly across all datasets, which might introduce bias when dealing with highly specialized jargon found in legal or medical fields.

Summary updated

BibTeX
@inproceedings{choi2025rag,
  author = {Chanwoo Choi and Jinsoo Kim and Sukmin Cho and Soyeong Jeong and Buru Chang},
  title = {{The RAG Paradox: A Black-Box Attack Exploiting Unintentional Vulnerabilities in Retrieval-Augmented Generation Systems}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2025},
}
Figure