arXiv:2410.22832cs.CRcs.AI2024-10被引 25

攻击者通过污染知识库,让RAG系统回答预设错误答案。

HijackRAG: Hijacking Attacks against Retrieval-Augmented Large Language Models

  • 向知识库注入恶意文本,操控检索机制
  • 在多个数据集上攻击成功率超90%
  • 现有防御方法均无效,适合安全研究者关注

检索增强生成(RAG)系统通过整合外部知识提升大语言模型的适应性与成本效益,但其依赖也带来新安全隐患。本文揭示一种新型漏洞——检索提示劫持攻击(HijackRAG),攻击者可将恶意文本注入知识库,使RAG系统在面对目标问题时输出攻击者预设的答案,破坏系统完整性与可信度。我们形式化该攻击为优化问题,提出黑盒与白盒两种攻击策略,适用于不同信息掌握程度的攻击者。在多个基准数据集上的大量实验表明,HijackRAG持续实现高攻击成功率,显著优于现有基线攻击。此外,该攻击在不同检索器模型间具备迁移能力,凸显其广泛威胁性。最后,我们测试了多种防御机制,发现均无法有效抵御此攻击,强调亟需更强大的安全防护措施以保障RAG系统在真实场景中的部署安全。

原文摘要 · Abstract (English)

Retrieval-Augmented Generation (RAG) systems enhance large language models (LLMs) by integrating external knowledge, making them adaptable and cost-effective for various applications. However, the growing reliance on these systems also introduces potential security risks. In this work, we reveal a novel vulnerability, the retrieval prompt hijack attack (HijackRAG), which enables attackers to manipulate the retrieval mechanisms of RAG systems by injecting malicious texts into the knowledge database. When the RAG system encounters target questions, it generates the attacker's pre-determined answers instead of the correct ones, undermining the integrity and trustworthiness of the system. We formalize HijackRAG as an optimization problem and propose both black-box and white-box attack strategies tailored to different levels of the attacker's knowledge. Extensive experiments on multiple benchmark datasets show that HijackRAG consistently achieves high attack success rates, outperforming existing baseline attacks. Furthermore, we demonstrate that the attack is transferable across different retriever models, underscoring the widespread risk it poses to RAG systems. Lastly, our exploration of various defense mechanisms reveals that they are insufficient to counter HijackRAG, emphasizing the urgent need for more robust security measures to protect RAG systems in real-world deployments.

RAG安全提示攻击知识库污染

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。