When LoRA Betrays: Backdooring Text-to-Image Models by Masquerading as Benign Adapters
Organizations: People’s Public Security University of China
Abstract
Low-Rank Adaptation (LoRA) has emerged as a leading technique for efficiently fine-tuning text-to-image diffusion models, and its widespread adoption on open-source platforms has fostered a vibrant culture of model sharing and customization. However, the same modular and plug-and-play flexibility that makes LoRA appealing also introduces a broader attack surface. To highlight this risk, we propose Masquerade-LoRA (MasqLoRA), the first systematic attack framework that leverages an independent LoRA module as the attack vehicle to stealthily inject malicious behavior into text-to-image diffusion models. MasqLoRA operates by freezing the base model parameters and updating only the low-rank adapter weights using a small number of "trigger word-target image" pairs. This enables the attacker to train a standalone backdoor LoRA module that embeds a hidden cross-modal mapping: when the module is loaded and a specific textual trigger is provided, the model produces a predefined visual output; otherwise, it behaves indistinguishably from the benign model, ensuring the stealthiness of the attack. Experimental results demonstrate that MasqLoRA can be trained with minimal resource overhead and achieves a high attack success rate of 99.8%. MasqLoRA reveals a severe and unique threat in the AI supply chain, underscoring the urgent need for dedicated defense mechanisms for the LoRA-centric sharing ecosystem.
Figures & tables
| Method | Attack Effectiveness | Functionality Preservation | Impact on Base Model | ||||
| ASR (%) | SMI | FID | CLIP Score | LPIPS | Params | Non-Invasive | |
| SD v1.5 | 0 | - | - | 33.12 | - | - | |
| BadT2I [ 46 ] | 75.2 | 1.32 | 16.56 | 28.45 | 0.148 | ✗ | |
| Personalization [ 19 ] | 82.5 | 1.36 | 28.46 | 27.43 | 0.143 | ✗ | |
| EvilEdit [ 39 ] | 98.3 | 1.38 | 16.31 | 28.31 | 0.135 | ✗ | |
| Benign LoRA (SD v1.5) | 0 | - | - | 32.36 | - | ✓ | |
| Style | NSFW Category | Benign Function | ||||||
|---|---|---|---|---|---|---|---|---|
| Nudity | Violence | Horror | Gore | Deformity | Self-harm | FID | CLIP Score | |
| cyberpunk | 87.5 / 1.34 | 86.1 / 1.34 | 75.1 / 1.37 | 78.5 / 1.37 | 88.1 / 1.36 | 79.4 / 1.35 | 30.4 | 29.65 |
| ink and wash | 86.2 / 1.38 | 79.5 / 1.32 | 85.4 / 1.35 | 75.9 / 1.34 | 78.1 / 1.35 | 81.3 / 1.33 | 30.5 | 31.12 |
| impressionism | 79.1 / 1.35 | 87.0 / 1.34 | 81.3 / 1.31 | 78.0 / 1.37 | 78.3 / 1.34 | 80.6 / 1.31 | 28.6 | 30.61 |
| oil painting | 79.8 / 1.37 | 85.1 / 1.33 | 78.6 / 1.34 | 82.7 / 1.35 | 79.0 / 1.36 | 81.4 / 1.38 | 32.7 | 30.63 |
| two-dimensional | 81.5 / 1.36 | 78.2 / 1.37 | 78.0 / 1.32 | 79.1 / 1.35 | 79.5 / 1.33 | 83.7 / 1.39 | 30.3 | 28.60 |
| Scenario | Metric | Number of MasqLoRAs | |||
|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | ||
| Scenario #1 | ASR (%) | 99.8 | 96.8 | 94.5 | 91.6 |
| CLIP Score | 31.22 | 31.1 | 30.8 | 27.3 | |
| Scenario #2 | ASR (%) | 81.4 | 77.2 | 68.7 | 65.5 |
| CLIP Score | 30.6 | 27.3 | 25.9 | 23.4 | |
T2I Diffusion Models
Text-to-image (T2I) diffusion models generate images from prompts by learning to reverse noise under text conditioning.
See all 393 papers