Skip to content

PoisonedRAG: A knowledge poisoning attack against large language model retrieval-augmented generation (RAG)

PoisonedRAG: Knowledge Corruption Attacks to Retrieval-Augmented Generation of Large Language Models

arXiv· arXiv:2402.07867· USENIX Security 2025· Wei Zou, Runpeng Geng, Binghui Wang, Jinyuan JiaPennsylvania State University; Illinois Institute of TechnologyIndexed by this site · 15 days ago· Originally publishedSelected AttacksSelectedAttention41

Translation in progress — untranslated text is omitted.

Quick read

Attacks

Based on the paper PDF (AI-generated); refer to the original

AI summaryResearchers from Pennsylvania State University and Illinois Institute of Technology propose PoisonedRAG, which injects a small amount of malicious text into a RAG system's knowledge database to induce large language models to generate specified answers to attacker-chosen target questions; the authors call it the first knowledge poisoning attack against RAG. The method splits malicious text into two sub-texts, respectively satisfying the retrieval condition of being hit by the retriever and the generation condition of misleading the LLM into generating the target answer, and is constructed in both black-box and white-box settings. On the NQ, HotpotQA, and MS-MARCO datasets and 8 LLMs including GPT-4, PaLM 2, and LLaMA-2, injecting 5 malicious texts per target question into a knowledge base containing millions of clean texts achieves an attack success rate of up to 90%, reaching 97% on PaLM 2 in the NQ black-box setting; it is also effective against advanced RAG schemes such as Self-RAG and CRAG, Wikipedia-based chatbots, and ReAct Agent.

Questions
RAG uses external knowledge bases to mitigate LLM knowledge staleness and hallucination, but the authors argue that the knowledge base itself constitutes a new attack surface: an attacker can inject malicious text to make the LLM output an attacker-chosen answer to a target question. Existing research mostly focuses on the accuracy and efficiency of RAG.
Methods
The authors formalize the knowledge corruption attack as an optimization problem, separating the retrieval condition and the generation condition: malicious text P=S⊕I, where I is generated by an LLM to induce the target answer; under black-box, S is the target question itself, and under white-box, S is optimized with HotFlip etc. to increase similarity to the question.
Experiments and results
On NQ, HotpotQA, MS-MARCO and 8 LLMs, injecting 5 pieces of malicious text per question, black-box ASR is mostly 0.88–0.99 (Table 1); on NQ, the ASR of all 5 baselines is below 0.70; the four defenses of paraphrasing, perplexity detection, deduplication, and knowledge expansion all fail to effectively prevent it.
Limitations and future work
The authors note that the attack constructs text independently for each target question and does not jointly consider multiple target questions, leaving this for future work; the experiments are limited to closed-ended question answering and FEVER fact verification, with open-ended questions only mentioned in Section 8 and not evaluated; the manual evaluation was conducted by the authors themselves.
Why it was selectedThe authors' own test found that injecting 5 malicious texts per question into a knowledge base containing millions of texts can reach a 90% attack success rate; teams deploying RAG can use this to assess knowledge base poisoning risk.

The authors' own test found that injecting 5 malicious texts per question into a knowledge base containing millions of texts can reach a 90% attack success rate; teams deploying RAG can use this to assess knowledge base poisoning risk.

Related events and news

2 events · 3 news mentions

News that mentions this paper

研究:17款主流LLM中94.1%存在智能体攻击漏洞

斗象科技开源AI Agent安全评测工具AI Beat

Related papers

Show 3 more papers
Read originalUSENIX Security 2025