Practical, Generalizable and Robust Backdoor Attacks on Text-to-Image Diffusion Models

Haoran Dai, Jiawen Wang, Ruo Yang, Manali Sharma, Zhonghao Liao, Yuan Hong, Binghui WangarXiv 2025 · DOI

Introduction

Text-to-image (T2I) diffusion models have become foundational tools in various sectors, from creative arts to medical diagnostics. However, their reliance on large-scale training data introduces a significant security vulnerability: backdoor attacks. In these attacks, an adversary poisons a small portion of the training set so that the model behaves normally for standard inputs but generates a specific, malicious target image when a secret "trigger" word is present in the prompt.

Previous backdoor attempts have often been impractical, relying on nonsensical Unicode strings that are easily detected by filters, or requiring massive amounts of poisoned data. This research introduces a new framework designed to be practical, generalizable, and robust, achieving high success rates with minimal data and natural-sounding triggers.

Methodology: A Three-Phase Attack Framework

The authors propose a novel strategy that bridges the semantic gap between text triggers and target images to maximize attack efficiency.

The three-phase methodology for injecting backdoors into T2I models, including trigger generation, CLIP-space optimization, and LoRA finetuning.

Phase 1: Natural Trigger Generation

To bypass perplexity-based filters, the framework uses Large Language Models (LLMs) like GPT-4o to generate semantically natural triggers. Instead of gibberish, the trigger is a contextually appropriate word. For instance, if the base prompt is "an image of a banana," the LLM might suggest "an image of a banana and a hand," where "hand" serves as the trigger.

Phase 2: CLIP-Space Optimization

The core innovation lies in optimizing the target image in the CLIP latent space. Since modern T2I models use CLIP for text-image alignment, the researchers use Projected Gradient Descent (PGD) to create a perturbed version of the target image. This perturbed image remains visually identical to the original but is semantically "closer" to the trigger word in CLIP's eyes, making it significantly easier for the diffusion model to learn the association.

Phase 3: Efficient Finetuning

The model is finetuned using Low-Rank Adaptation (LoRA) on a tiny dataset consisting of only 10 poisoned pairs and a few clean samples. This ensures the attack is data-efficient while preserving the model's original utility for benign prompts.

Experimental Results and Insights

The framework was evaluated across multiple architectures, including Stable Diffusion 1.4, SDXL, and the 12-billion-parameter FLUX.1.

Comparison of benign and backdoored model outputs across different categories (Mammal, Fruit, Vehicle) and target image complexities.

Key Findings

  • High Success Rate: With just 10 poisoned samples, the attack consistently achieved a success rate exceeding 90% across all tested models.
  • Stealthiness and Robustness: The poisoned prompts maintain perplexity scores similar to clean text, making them invisible to statistical filters. Furthermore, the attack proved robust against state-of-the-art defenses like T2IShield and prompt obfuscation techniques.
  • The Entropy Factor: Interestingly, the researchers found that "high-entropy" targets (complex, detailed images) are easier to inject than "low-entropy" targets (like solid colors). Complex images provide more features for the model to latch onto during the brief finetuning process.

Conclusion

This research demonstrates that T2I diffusion models are highly susceptible to sophisticated, low-data backdoor attacks that use natural language as a cloak. By leveraging the shared latent space of CLIP, attackers can inject persistent backdoors with minimal effort. These findings highlight a critical gap in current AI safety mechanisms and underscore the need for more robust detection methods that can identify semantically natural malicious injections.

Summary updated

BibTeX
@misc{dai2025practical,
  author = {Haoran Dai and Jiawen Wang and Ruo Yang and Manali Sharma and Zhonghao Liao and Yuan Hong and Binghui Wang},
  title = {{Practical, Generalizable and Robust Backdoor Attacks on Text-to-Image Diffusion Models}},
  year = {2025},
  eprint = {2508.01605},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2508.01605},
}
Figure