攻击者通过污染系统提示词,长期操控大模型输出,无需越狱即可生效。
System Prompt Poisoning: Persistent Attacks on Large Language Models Beyond User Injection
- 通过污染系统级提示词实现持久性攻击,影响所有后续用户交互。
- 在数学、编程、逻辑推理等任务中均有效,即使使用思维链等高级技巧也难防御。
- 揭示了增强模型性能的常见技术(如CoT、RAG)反而会加剧安全风险。
大型语言模型(LLMs)因其强大的生成能力被广泛应用于各类场景,其即插即用特性使开发者和用户可通过简单提示进行交互。然而,随着其在各领域深度集成,安全问题日益凸显。现有研究多关注用户提示注入或模型输出泄露等威胁,而忽视了系统提示的安全隐患。本文首次提出系统提示污染攻击,不同于传统用户提示注入,该攻击通过污染系统提示,持续影响所有后续用户交互与模型响应。我们系统研究了四种实用攻击策略,在生成与推理类LLM上验证其可行性:无需越狱即可成功,覆盖数学、编程、逻辑推理与自然语言处理等任务。重要的是,该攻击在用户采用思维链(CoT)等先进提示技术时依然有效;同时,这些提升模型性能的技术(如CoT、检索增强生成RAG)反而因系统提示污染而显著失效。
原文摘要 · Abstract (English)
Large language models (LLMs) have gained widespread adoption across diverse applications due to their impressive generative capabilities. Their plug-and-play nature enables both developers and end users to interact with these models through simple prompts. However, as LLMs become more integrated into various systems in diverse domains, concerns around their security are growing. Existing studies mainly focus on threats arising from user prompts (e.g. prompt injection attack) and model output (e.g. model inversion attack), while the security of system prompts remains largely overlooked. This work bridges the critical gap. We introduce system prompt poisoning, a new attack vector against LLMs that, unlike traditional user prompt injection, poisons system prompts hence persistently impacts all subsequent user interactions and model responses. We systematically investigate four practical attack strategies in various poisoning scenarios. Through demonstration on both generative and reasoning LLMs, we show that system prompt poisoning is highly feasible without requiring jailbreak techniques, and effective across a wide range of tasks, including those in mathematics, coding, logical reasoning, and natural language processing. Importantly, our findings reveal that the attack remains effective even when user prompts employ advanced prompting techniques like chain-of-thought (CoT). We also show that such techniques, including CoT and retrieval-augmentation-generation (RAG), which are proven to be effective for improving LLM performance in a wide range of tasks, are significantly weakened in their effectiveness by system prompt poisoning.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。