揭秘网页聊天机器人插件中的提示注入漏洞
When AI Meets the Web: Prompt Injection Risks in Third-Party AI Chatbot Plugins
- 8000个网站使用的8款插件未校验对话历史,可被伪造
- 伪造对话历史使越狱攻击成功率提升3至8倍
- 13%电商网站已暴露于第三方内容的间接注入风险
提示注入攻击对大语言模型构成严重威胁,以往研究多聚焦于先进应用如个人协作者。相比之下,广泛部署于网页的简易聊天机器人(如客服机器人)及其安全状况仍不清晰。这些应用常依赖第三方聊天机器人插件作为中介,连接商业LLM API,供非专业人士定制行为。本文首次对17款使用超过10,000个公共网站的第三方插件展开大规模研究,发现实际存在的提示注入风险:其一,8款插件(覆盖8,000个网站)未强制校验传入网络请求中的对话历史完整性,导致攻击者可伪造对话记录(包括虚假系统消息),使诱发异常行为(如代码生成)的成功率提升3至8倍;其二,15款插件提供网页抓取工具以增强上下文,但未区分可信内容(如产品描述)与不可信第三方内容(如用户评论),引入间接提示注入风险。值得注意的是,约13%的电商网站已将聊天机器人暴露于第三方内容中。我们基于真实场景开展受控实验,评估两种漏洞,重点考察系统提示设计与底层LLM的影响。结果表明,诸多插件采用不安全实践,削弱了内置的LLM防护机制。
原文摘要 · Abstract (English)
Prompt injection attacks pose a critical threat to large language models (LLMs), with prior work focusing on cutting-edge LLM applications like personal copilots. In contrast, simpler LLM applications, such as customer service chatbots, are widespread on the web, yet their security posture and exposure to such attacks remain poorly understood. These applications often rely on third-party chatbot plugins that act as intermediaries to commercial LLM APIs, offering non-expert website builders intuitive ways to customize chatbot behaviors. To bridge this gap, we present the first large-scale study of 17 third-party chatbot plugins used by over 10,000 public websites, uncovering previously unknown prompt injection risks in practice. First, 8 of these plugins (used by 8,000 websites) fail to enforce the integrity of the conversation history transmitted in network requests between the website visitor and the chatbot. This oversight amplifies the impact of direct prompt injection attacks by allowing adversaries to forge conversation histories (including fake system messages), boosting their ability to elicit unintended behavior (e.g., code generation) by 3 to 8x. Second, 15 plugins offer tools, such as web-scraping, to enrich the chatbot's context with website-specific content. However, these tools do not distinguish the website's trusted content (e.g., product descriptions) from untrusted, third-party content (e.g., customer reviews), introducing a risk of indirect prompt injection. Notably, we found that ~13% of e-commerce websites have already exposed their chatbots to third-party content. We systematically evaluate both vulnerabilities through controlled experiments grounded in real-world observations, focusing on factors such as system prompt design and the underlying LLM. Our findings show that many plugins adopt insecure practices that undermine the built-in LLM safeguards.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。