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
Translation in progress — untranslated text is omitted.
Researchers 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.
- 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.
- 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.
- 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.
- 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.
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
- The reports mention PoisonedRAG
研究:17款主流LLM中94.1%存在智能体攻击漏洞
- The reports cite this paper
斗象科技开源AI Agent安全评测工具AI Beat
News that mentions this paper
研究:17款主流LLM中94.1%存在智能体攻击漏洞
- 公众号 为机器立心names the paper意大利卡拉布里亚大学:17 款主流 LLM 中 94.1% 至少存在一类智能体攻击漏洞
现有研究(如TrojanRAG、PoisonedRAG)主要通过污染RAG知识库使LLM生成攻击者指定的错误答案或引入偏见,未涉及诱导LLM执行危害系统安全的操作;
斗象科技开源AI Agent安全评测工具AI Beat
- 公众号 句芒安全实验室cites the paper's id or linkAI Agent安全评测:AI Beat三层证据L1-L3+红队越狱实测
论文是 PoisonedRAG,arXiv:2402.07867,USENIX Security 2025。
- Adversa AInames the paperOWASP ASI01 智能体目标劫持实用安全指南
RAG knowledge Poisoned documents in vector store PoisonedRAG (90% success with 5 docs)