PIDP-Attack: Combining Prompt Injection with Database Poisoning Attacks on Retrieval-Augmented Generation Systems
Haozhen Wang, Haoyue Liu, Jionghao Zhu, Zhichao Wang, Yongxin Guo, Xiaoying Tang, [6pt] The Chinese University of Hong Kong, Shenzhen, [4pt] Equal contribution. Corresponding author. · 2026
Read PIDP-Attack: Combining Prompt Injection with Database Poisoning Attacks on Retrieval-Augmented Generation Systems by Haozhen Wang, Haoyue Liu, Jionghao Zhu, Zhichao Wang, Yongxin Guo, Xiaoying Tang, [6pt] The Chinese University of Hong Kong, Shenzhen, [4pt] Equal contribution. Corresponding author. (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2603-25164.txt.
Introduction
Wang and co-authors attack systems that pair a language model with a search database. Such RAG systems can be poisoned by bad passages planted in the store. Older attacks need to know the user's question first. PIDP-Attack joins prompt injection with poisoning, so it needs no such knowledge. Odd marks added to any query at run time steer the model toward planted text. Across three question sets and eight models, it beats the prior PoisonedRAG method. Success rates rise by 4 to 16 points while retrieval stays sharp.
Catalog record
| CREATOR | Haozhen Wang, Haoyue Liu, Jionghao Zhu, Zhichao Wang, Yongxin Guo, Xiaoying Tang, [6pt] The Chinese University of Hong Kong, Shenzhen, [4pt] Equal contribution. Corresponding author. |
|---|---|
| YEAR | 2026 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 76309 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2603.25164
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
PIDP-Attack: Combining Prompt Injection with Database Poisoning Attacks on Retrieval-Augmented Generation Systems Haozhen Wang, Haoyue Liu, Jionghao Zhu, Zhichao Wang, Yongxin Guo, Xiaoying Tang, [6pt] The Chinese University of Hong Kong, Shenzhen, [4pt] Equal contribution. Corresponding author. Abstract Large Language Models (LLMs) have demonstrated remarkable performance across a wide range of applications. However, their practical deployment is often hindered by issues such as outdated knowledge and the tendency to generate hallucinations. To address these limitations, Retrieval-Augmented Generation (RAG) systems have been introduced, enhancing LLMs with external, up-to-date knowledge sources. Despite their advantages, RAG systems remain vulnerable to adversarial attacks, with data poisoning emerging as a prominent threat. Existing poisoning-based attacks typically require prior knowledge of the user’s specific queries, limiting their flexibility and real-world applicability. In this work, we propose PIDP-Attack, a novel compound attack that integrates prompt injection with database poisoning in RAG. By appending malicious characters to queries at inference time and injecting a limited number of poisoned passages into the retrieval database, our method can effectively manipulate LLM response to arbitrary query without prior knowledge of the user’s actual query. Experimental evaluations across three benchmark datasets (Natural Questions, HotpotQA, MS-MARCO) and eight LLMs demonstrate that PIDP-Attack consistently outperforms the original PoisonedRAG. Specifically, our method improves attack success rates by 4%–16% on open-domain QA tasks while maintaining high retrieval precision, proving that the compound attack strategy is both necessary and highly effective. 1 Introduction Large Language Models (LLMs) have achieved remarkable success and are increasingly deployed across diverse domains, including healthcare [ 26 ] , finance [ 49 ] , and mathematical sciences [ 28 ] , due to their exceptional generative capabilities. However, their widespread application is hindered by inherent limitations, such as a lack of up-to-date knowledge and a tendency to generate hallucinations [ 48 ] —factually incorrect or ungrounded content. To mitigate these issues, Retrieval-Augmented Generation (RAG) [ 43 , 7 , 4 , 31 ] has emerged as a state-of-the-art paradigm. A RAG system comprises three core components: a database, a retriever, and a generator (typically a large language model). The database contains a vast collection of texts gathered from various sources, such as Wikipedia [ 33 ] , web documents [ 38 ] , and others. Upon receiving a user query, the retriever calculates the semantic similarity between the query and the documents in the database, returning the top- k most relevant documents. These retrieved documents, together with the user query, are subsequently forwarded to the generator as input for the large language model, which then generates the corresponding response based on this combined information. RAG systems augment an LLM by grounding its responses in relevant, external knowledge retrieved from a large-scale database, thereby enhancing the factual accuracy and timeliness of generated answers. Motivation. Despite its benefits, the RAG architecture introduces new security vulnerabilities by expanding the attack surface. The integrity of the system now critically depends not only on the LLM itself but also on the external knowledge database and the retrieval process. Recent research has begun to explore these vulnerabilities, identifying two primary attack vectors. The first is exemplified by data poisoning attacks such as PoisonedRAG [ 52 ] , which involve injecting malicious passages into the knowledge database. The attacker’s goal is to craft these texts so that they are retrieved for specific target questions and subsequently mislead the LLM into generating attacker-chosen answers. The second vector comprises prompt injection attacks including GGPP [ 11 ] , where adversarial instructions are embedded into the user’s input query to hijack the model’s output. Property Corpus GCG Clean-RAG GGPP Disinformation PoisonedRAG PR-Attack PIDP Query-path manipulation ✗ ✓ ✓ ✓ ✗ ✗ ✓ ✓ Corpus-path manipulation ✓ ✗ ✗ ✗ ✓ ✓ ✓ ✓ Unaware of user query ✗ ✓ ✓ ✗ ✗ ✗ ✗ ✓ Retrieval steering ✓ ✗ ✗ ✓ ✓ ✓ ✓ ✓ Retriever black-box ✗ ✓ ✓ ✗ ✓ ✓ ✗ ✓ LLM black-box ✓ ✗ ✓ ✓ ✓ ✓ ✗ ✓ Local lightweight computation ✗ ✗ ✓ ✗ ✓ ✓ ✗ ✓ Average ASR 1.875% 3.125% 45.778% 82.875% 88.333% 92% 97.167% 98.125% Table 1: Comparison of attack capabilities. ✓ = supported, ✗ = not supported. Clean-RAG is our ablation variant using only query-path injection. However, existing attacks possess significant limitations that constrain their practicality and stealth. As shown in Table 1 , data poisoning attacks including Corpus Poisoning [ 50 ] , Disinformation Attack [ 23 ] , PoisonedRAG [ 52 ] , and PR-Attack [ 15 ] operate under a strong assumption: the attacker must know the exact target questions in advance to craft and inject corresponding poisoned passages. This requirement reduces flexibility in real-world scenarios where user queries are dynamic and unpredictable. Relaxing this assumption is critical for realistic threat modeling: attackers rarely have advance knowledge of victim queries, and query-agnostic attacks are both more stealthy (no per-query customization needed) and more scalable (a single poisoning effort can affect arbitrary queries). Conversely, prompt injection attacks such as GCG Attack [ 51 ] , GGPP [ 11 ] , and Clean-RAG (our ablation variant using only query-path injection discussed in Section 4,2,2) often lack the persistence and grounding provided by database corruption, resulting in lower effectiveness compared to data poisoning attacks. Additionally, we note that many attacks are white-box attacks, which require the attacker to access internal parameters of the retriever or large language models. This restricts the practical application of such attacks in real-world scenarios and significantly increases the local computational burden on the attacker. To bridge this gap, we propose PIDP-Attack (Prompt Injection and Database Poisoning Attack), a novel, flexible, and potent compound black-box attack strategy targeting RAG systems. Our method operates through a two-pronged mechanism: first, it injects a limited set of universal poisoned passages into the knowledge database; second, it appends a lightweight, malicious suffix to any user query at inference time. This suffix acts as a dynamic prompt injection that interacts with the pre-positioned poisoned passages in the database. The key insight is that the injected suffix can steer the retriever towards the malicious passages regardless of the original user questions, and together they coerce the LLM to generate an answer to a different, attacker-specified target question. This approach offers a decisive advantage: it enables an attacker to manipulate the RAG system’s output without knowing the victim’s actual query beforehand, and Inject only a handful of poisoned texts into the database can cause the model to output a target response to any query, thereby achieving a higher degree of operational flexibility and realism. Extensive experimental evaluations across multiple benchmark datasets (Natural Questions, HotpotQA, MS-MARCO), and several state-of-the-art LLMs demonstrate the efficacy of PIDP-Attack. Our results show that it achieves a higher attack success rate (ASR) compared to other attacks across most scenarios with a limited number of poisoned passages. Contributions. Our main contributions are as follows: • We propose PIDP-Attack, a novel compound attack that combines prompt injection with database poisoning, eliminating the need for prior knowledge of user queries while maintaining high attack success rates. • The PIDP-attack requires injecting only n poisoned texts into the database—where n typically equals the retriever’s top- k value—to successfully manipulate the responses to arbitrary