Repeating the question is enough to poison RAG retrieval
Reviewing Reliability Stress Testing of RAG Retrieval under Query-Relevant Corpus Poisoning · Janet Sung, Kainan Zhou, Gangzhen Qian et al.

Researchers find that documents which simply repeat a user's query reliably push legitimate evidence out of a RAG system's retrieved context, and the injected payload barely matters. The weakness sits in retrieval, before the model reads anything, and the obvious filter that blocks these poisons also discards real evidence.
To get a document into a RAG system's context, an attacker does not need a clever exploit. In this research, the most effective trick was to write the user's question into a document and let it be indexed. The retriever did the rest.
Retrieval is the gate. A RAG system answers a question by ranking documents in its corpus against the query, then handing the top handful to the model. Anything that ranks well gets read. Anything that does not is invisible. The researchers attacked only that ranking step, using scientific and medical question sets. They tested several common retrievers: keyword matching, a statistical model of word meaning, a blend of the two, and a small pretrained embedding model.
The poison documents were simple. Some just repeated the query. Others appended a standard prompt injection payload, or neutral text taken from the corpus. Five such documents per query, a tiny fraction of the corpus, cut the blended retriever's ranking quality by more than half on the scientific set. Legitimate evidence was pushed out of the top ten.
The payload barely matters
What interested me is where the damage came from. For keyword matching, repeating the query explained almost all of it. The embedding model is the clearest case: query-only poisons reached the top ten for every query on both datasets. Adding the injection payload changed almost nothing, and on one dataset it slightly reduced exposure.
This is not a new attack. It is keyword stuffing, the oldest trick in search spam, aimed at a new target. The difference is that the reader at the end of the pipeline is now a model that may act on what it reads.
The attacker does not even need the whole question. On long queries, two random terms, roughly a fifth of the usable words, still got a poison into the blended retriever's top ten in 39.5% of cases. Four terms took that close to nine in ten. Poison many queries at once and the poisons start crowding the top ten together.
The preconditions are modest. The attacker must be able to publish content that gets indexed, and must know or guess something about what users ask. The study also stops at retrieval. It shows the text arrives, not that the model then obeys it.
The defences tested were not encouraging. Rejecting documents that overlap heavily with the query removes the full-query poisons, but often removes the real evidence too, because real evidence also shares words with the question. Reranking for diversity left exposure unchanged in the tested setup. Neither faced an attacker who knows the filter is there, and the next move is obvious: anchor on fewer terms, just under the threshold.
I would treat write access to the corpus as attack surface, and document provenance as a control rather than a nicety. The retriever trusts whoever repeats the question.
Further analysis
Problem
The paper studies how adversarially injected documents in a retrieval-augmented generation (RAG) corpus can influence which documents a retriever admits to a model context, and thereby degrade evidence retrieval before any generation occurs. This admission step matters because an attacker who can publish indexed content but cannot change queries or retriever parameters may still displace legitimate evidence by anchoring on query terms or by appending content. The work isolates retrieval-stage effects, quantifies exposure and ranking degradation, and evaluates simple admission controls.
Approach
The authors stress the retrieval admission boundary across three axes: per-target poison budget P in {1,3,5}, contamination scope (isolated per-query poisons versus many poisoned targets in the same corpus), and attacker query information (no terms, two or four terms, or the full query; high-IDF or random-term selection). Experiments use 623 BEIR queries from SciFact and NFCorpus with three retrievers: BM25, 64-dimensional LSA, and a reciprocal-rank-fusion Hybrid, plus a pretrained dense BGE-small encoder for validation. Poison documents either repeat query terms only, append standard payloads from an indirect prompt-injection benchmark, or append neutral corpus-derived text. Metrics include nDCG@10, Recall@10, target exposure@10, any-poison exposure@10, evidence availability, and a strict SafeRetrievalReliability measure that requires judged evidence with zero poison in top candidates. The study reports isolated and multi-target contamination, paired bootstrap intervals, and latency measurements.
Key Findings
- Small, query-targeted contamination is highly effective: five poisoned documents per query (P=5), though only 0.10–0.14% of the corpus when isolated, reduce Hybrid nDCG@10 by large margins (for example Hybrid nDCG falls from 0.465 to 0.183 on SciFact and from 0.267 to 0.160 on NFCorpus under isolated P=5 query+payload stress).
- Query anchoring explains most BM25 degradation: simply repeating the query in poison documents accounts for nearly all BM25 ranking loss, while appended text has additional effects on LSA and Hybrid rankings, especially on NFCorpus.
- Dense retriever validation: a pretrained BGE-small bi-encoder reached 100% target exposure for query-only P=5 on both datasets; adding malicious payloads changed SciFact nDCG minimally and slightly reduced NFCorpus exposure, indicating query anchoring dominates for that dense model.
- Partial-information attacks matter on long queries: on 162 long SciFact queries two random terms covered 19.9% of eligible terms but still produced 39.5% Hybrid target exposure; four terms produced 89.5% exposure.
- Multi-target contamination causes cross-target interference and saturation: when many targets are poisoned simultaneously, any-poison exposure and the mean number of poisoned documents in top-k increase substantially, showing a different failure mode than isolated targeting.
- Defences trade safety for utility: an overlap-based admission filter can remove full-query poisons at a high threshold but often cuts legitimate evidence and lowers clean nDCG, while maximal marginal relevance largely failed to reduce exposure in tested settings.
Limitations
The study measures retrieval-layer admission and not downstream instruction following. BEIR qrels are incomplete so evidence metrics inherit label incompleteness. Payloads and neutral controls do not perfectly match real malicious content. Dense-retriever validation is limited to one compact model and production vector-search systems and larger embeddings remain outside scope. High-IDF anchors are oracle-like conditions rather than assumed attacker capabilities.
Implications
An attacker who can publish indexed documents can cause high likelihood of poisoned documents entering a RAG context by repeating query terms or revealing partial query information, thereby displacing legitimate evidence before any generation. This enables pre-generation manipulation of what the model can see, and combined with multi-target contamination it can saturate top-k results. Defences that reject high-overlap documents can block full-query poisons but risk removing useful evidence, producing a difficult utility-security trade-off.
The paper title, authors and abstract
Reliability Stress Testing of RAG Retrieval under Query-Relevant Corpus Poisoning
External text can affect a retrieval-augmented generation (RAG) system only after the retriever admits it to the model context. We stress this admission step while varying document content, attacker query information, per-target poison budget, and contamination scope. Across 623 Benchmarking Information Retrieval (BEIR) queries from SciFact and NFCorpus, five query-targeted documents per query reduce classical-retriever nDCG@10 by 40.2-61.5% in isolated-target stress. Full-query anchoring explains most Best Matching 25 (BM25) degradation, whereas appended text also shifts latent semantic analysis (LSA) and Hybrid rankings. A pretrained BGE-small validation reaches 100% target exposure for query-only P=5 on both datasets; adding the injection payload changes SciFact nDCG only from 0.269 to 0.271 and lowers NFCorpus exposure slightly to 98.8%, indicating that query anchoring remains the dominant retrieval-side factor for this dense model. Query length materially changes the interpretation of partial-information attacks: on 162 long SciFact queries, two random terms cover 19.9% of eligible terms and still yield 39.5% Hybrid target exposure. Multi-target contamination adds cross-target interference. Overlap-based admission can remove full-query poisons but may sharply reduce clean retrieval utility, and maximal marginal relevance (MMR) leaves exposure unchanged under the tested configuration. The study measures retrieval-layer failures, not downstream instruction following.


