arXiv:2509.09488cs.CRcs.AI2025-09被引 2

破解扩散模型生成图像的随机种子,可大幅提高提示词窃取成功率。

Prompt Pirates Need a Map: Stealing Seeds helps Stealing Prompts

  • 利用遗传算法结合恢复的种子,精准反推生成图像的原始提示词。
  • 95%的CivitAI图像种子可在140分钟内被暴力破解,提示词还原准确率提升8-11%。
  • 揭示PyTorch种子范围漏洞,提供无需修改框架的防御方案。

扩散模型在文本到图像生成中取得显著进展,能够根据文本提示和随机种子生成高度逼真的图像。由于提示词蕴含巨大的智力与经济价值,提示词窃取已成为关键安全与隐私问题。本文研究针对扩散模型的提示词窃取攻击,发现基于数值优化的提示恢复方法因未考虑生成时的初始随机噪声而存在根本性局限。我们识别并利用了广泛存在于主流生成框架中的噪声生成漏洞(CWE-339),源于PyTorch在CPU上生成初始噪声时将种子值限制在2^32范围内。通过对CivitAI平台共享的图像进行大规模实证分析,我们证明使用种子恢复工具SeedSnitch,约95%的图像种子可在每种子140分钟内被有效暴力破解。基于恢复的种子,提出基于遗传算法的提示窃取方法PromptPirate,其在LPIPS相似度上超越当前最优方法PromptStealer、P2HP和CLIP-Interrogator,提升8-11%。此外,我们提出简单有效的防御措施,可使种子窃取及基于优化的提示窃取失效。研究结果已负责任披露,并与开发者协同推动漏洞修复。

原文摘要 · Abstract (English)

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.

扩散模型提示词窃取安全漏洞生成对抗

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。