提示词窃取者需要地图:窃取种子有助于窃取提示词
Prompt Pirates Need a Map: Stealing Seeds helps Stealing Prompts
AI总结:
本文揭示了扩散模型中因 PyTorch 限制种子范围导致的噪声生成漏洞(CWE-339),提出种子恢复工具 SeedSnitch 及基于遗传算法的提示词窃取方法 PromptPirate,在 LPIPS 相似度上提升 8-11%,并给出了相应防御对策。
摘要:
扩散模型显著推进了文本到图像生成,使得能够根据文本提示词和种子创建高度逼真的图像。鉴于此类提示词中蕴含的巨大智力与经济价值,提示词窃取构成了严重的安全与隐私隐患。本文研究了针对扩散模型的提示词窃取攻击。我们揭示了基于数值优化的提示词恢复方法存在根本局限性,因为它们未考虑图像生成期间使用的初始随机噪声。我们识别并利用了主流图像生成框架中普遍存在的一种噪声生成漏洞(CWE-339),该漏洞源于 PyTorch 在 CPU 上生成初始随机噪声时将种子值限制在 $2^{32}$ 范围内。通过对热门平台 CivitAI 上共享的图像进行大规模实证分析,我们证明使用我们的种子恢复工具 SeedSnitch,每个种子可在 140 分钟内被有效暴力破解,约 95% 的此类图像的种子值可被恢复。利用恢复的种子,我们提出了 PromptPirate,这是一种基于遗传算法的优化方法,专为提示词窃取而设计。PromptPirate 超越了现有最先进方法,即 PromptStealer、P2HP 和 CLIP-Interrogator,在 LPIPS 相似度上实现了 8-11% 的提升。此外,我们引入了简单有效的对策,使种子窃取及基于优化的提示词窃取失效。我们已负责任地披露了研究结果,并与开发者启动了协调缓解措施以解决这一关键漏洞。
英文摘要:
Diffusion models have significantly advanced text-to-image generation, enabling the creation of highly realistic images conditioned on textual prompts and seeds. Given the considerable intellectual and economic value embedded in such prompts, prompt theft poses a critical security and privacy concern. In this paper, we investigate prompt-stealing attacks targeting diffusion models. We reveal that numerical optimization-based prompt recovery methods are fundamentally limited as they do not account for the initial random noise used during image generation. We identify and exploit a noise-generation vulnerability (CWE-339), prevalent in major image-generation frameworks, originating from PyTorch's restriction of seed values to a range of $2^{32}$ when generating the initial random noise on CPUs. Through a large-scale empirical analysis conducted on images shared via the popular platform CivitAI, we demonstrate that approximately 95% of these images' seed values can be effectively brute-forced in 140 minutes per seed using our seed-recovery tool, SeedSnitch. Leveraging the recovered seed, we propose PromptPirate, a genetic algorithm-based optimization method explicitly designed for prompt stealing. PromptPirate surpasses state-of-the-art methods, i.e., PromptStealer, P2HP, and CLIP-Interrogator, achieving an 8-11% improvement in LPIPS similarity. Furthermore, we introduce straightforward and effective countermeasures that render seed stealing, and thus optimization-based prompt stealing, ineffective. We have disclosed our findings responsibly and initiated coordinated mitigation efforts with the developers to address this critical vulnerability.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。