arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2606.18673cs.CR
收藏

理解并缓解真实世界基于LLM的应用中的提示泄露攻击

Understanding and Mitigating Prompt Leaking Attacks in Real-World LLM-Based Applications

Zhejiang University(浙江大学);Zhengzhou University(郑州大学)

Yong Yang, Chong Fu, Tong Zhang, Rui Zeng, Qingming Li, Tianyu Du, Zonghui Wang, Shouling Ji, Wenzhi Chen

AI总结:

本研究系统测量了1200个真实世界基于LLM的应用,发现超过80%会泄露系统提示,并提出了基于注意力漂移分析的AREA防御方法,在保持可用性的同时有效防止泄露。

摘要:

基于大型语言模型(LLM)的应用依赖系统提示来编码核心逻辑和开发者定义的约束,使得这些提示成为重要的知识产权。然而,系统提示容易受到提示泄露攻击。尽管先前的工作在受控环境中展示了此类攻击,但其在真实世界部署中的普遍性、原因和防御措施仍不清楚。本文对真实世界基于LLM的应用中的提示泄露进行了系统研究。我们测量了六个主要商业平台上的1200个应用,发现超过80%的部署在现实对抗性查询下泄露了系统提示,有时会暴露敏感信息,如第三方API密钥。我们还表明,现有防御措施往往无法在不降低可用性的情况下防止泄露。为了解释这些失败,我们进行了注意力层面的机制分析,并识别出注意力漂移,其中查询-键对齐偏差和softmax放大导致LLM逐渐忽略防御约束。基于这一洞察,我们提出了AREA,一种实用的防御方法,通过可优化的软提示重新锚定模型的注意力。实验和真实世界案例研究表明,AREA在匹配最先进防御措施的防泄露能力的同时,将平均可用性提高了33%以上,并将优化开销降低了近3倍。我们的负责任披露导致两家受影响的供应商将这些泄露归类为中危漏洞。

英文摘要:

Large language model (LLM)-based applications rely on system prompts to encode core logic and developer-defined constraints, making these prompts important intellectual property. However, system prompts are vulnerable to prompt leaking attacks. Although prior work has shown such attacks in controlled settings, their prevalence, causes, and defenses in real-world deployments remain unclear. This paper presents a systematic study of prompt leaking in real-world LLM-based applications. We measure 1,200 applications across six major commercial platforms and find that over 80% of deployments leak system prompts under realistic adversarial queries, sometimes exposing sensitive information such as third-party API keys. We also show that existing defenses often fail to prevent leakage without degrading usability. To explain these failures, we conduct an attention-level mechanistic analysis and identify attention drift, where query-key alignment bias and softmax amplification cause LLMs to progressively ignore defensive constraints. Guided by this insight, we propose AREA, a practical defense that re-anchors the model's attention using an optimizable soft prompt. Experiments and real-world case studies show that AREA matches the leakage resistance of state-of-the-art defenses while improving average usability by over 33% and reducing optimization overhead by nearly 3x. Our responsible disclosure led two affected vendors to classify these leaks as medium-severity vulnerabilities.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑