Not What You've Signed Up For: Compromising Real-World LLM-Integrated Applications with Indirect Prompt Injection
code: https://github.com/greshake/llm-security
LLM-Integrated App blur the line between data and instructions.
Indirect Prompt Injection, 通过向在推理过程中可能被检索的数据中注入prompt使攻击者可以远程利用LLM-Integrated App。
本文对由此引起的影响和漏洞进行分类,包括数据窃取,蠕虫,信息生态系统污染以及其他新的安全风险。并在真实世界的系统中进行测试,例如Bing Chat, code-completion engines以及GPT-4 synthetic App。并且演示如何通过对检索的prompt处理实现任意代码执行,控制应用的功能,并且控制其他相关API的调用方式。
Introduction
Indirect Prompt Injection
通过检索增强LLM时,如果攻击者对检索数据进行prompt injection,则会影响LLM推理结果,继而影响用户系统。

Threat Model

Injection Methods
- 假设:攻击者有能力在推理时远程毒害模型的潜在输入
- 与传统ML攻击的区别:简单易行
- Passive Method. 通过检索传递注入(e.g., 可能被搜索引擎查阅到的public resources)
- Active Method. e.g., 通过发送含有prompt的电子邮件
- User-Driven Injection. 用户复制了恶意prompt
- Hidden Injection. (1) multiple exploit stages. an initial smaller injection instructs the model to fetch a larger payload from another source. (2) multi-modal models. 将prompt隐藏在图像中. (3) 给出恶意Python程序(e.g., 输出具有偏见的信息),让LLM回答python代码的执行结果。
Threats