Introduction
ColJailBreak introduces a novel "generate-then-edit" strategy to bypass safety filters in commercial text-to-image (T2I) models like DALL·E 3. Instead of using complex adversarial prompts to force an unsafe image directly, the system generates a perfectly "safe" version first (e.g., replacing a gun with a speedgun) and then uses specialized image-editing tools to inject the prohibited content back into the scene.
What Problem Does This Paper Address?
Commercial T2I models employ strict "safety filters" to block the generation of Not-Safe-For-Work (NSFW) content, such as violence, nudity, or harassment. Existing "jailbreak" attempts usually rely on adversarial prompts—carefully crafted strings of text designed to confuse the filter.
However, these traditional methods have two major flaws:
- Fragility: Adversarial prompts often look like gibberish or nonsensical symbols. Once a specific "magic string" is discovered, developers can easily patch the filter to recognize and block it.
- Detection: Even if the text filter is bypassed, many systems use a secondary image-based filter that analyzes the final output and blocks it if it looks inappropriate.
The authors of ColJailBreak argue that these filters have a critical blind spot: they are heavily optimized for the initial generation but are often absent or significantly weaker in image editing workflows.
Methods: The ColJailBreak Framework
The ColJailBreak framework exploits this vulnerability by operating in three distinct phases:
- Adaptive Normal Safe Substitution: When a user provides an unsafe prompt (e.g., "A man points a pistol at a woman"), the system uses an LLM (like ChatGPT) to find a "safe" substitute that shares a similar physical shape (e.g., a water gun, drill, or hair dryer). This ensures the T2I model accepts the prompt and generates a high-quality, safe base image.
- Inpainting-Driven Injection: Once the safe image is generated, the system uses the Segment Anything Model (SAM) to automatically identify and mask the substituted object. It then employs an inpainting model to replace that specific region with the original unsafe object (the pistol).
- Contrastive Language-Image-Guided Optimization: To ensure the final image looks natural, the system doesn't just pick one substitute. It generates a pool of potential safe words and uses CLIP scores to select the one that, once edited, results in an image that most closely aligns with the original "unsafe" intent while maintaining high visual quality.
Datasets
The researchers evaluated their method using three primary sources:
- I2P (Inappropriate Image Prompts): A standard benchmark for testing T2I safety.
- VBCDE-100: A dataset focused on various categories of unsafe content.
- UnsafeEdit (New): The authors curated this dataset specifically for this task. It contains 100 prompts split across four categories: violence, harassment, self-harm, and nudity. It was built by taking unsafe prompts and manually creating safe "template" versions to test the substitution logic.
Key Insights and Ideas
- The "Shape Similarity" Advantage: The most clever part of this approach is choosing substitutes based on geometry. By replacing a dagger with a "staple gun" or a "drill," the system ensures the person in the image is already in the correct pose (holding something in their hand), making the final edit much more seamless and difficult for automated checkers to flag as "glitched."
- Exploiting the Safety Gap: The paper highlights a systemic vulnerability: while T2I models are heavily guarded, the "editing" models (inpainting) used in the second step often lack the same level of safety scrutiny, effectively acting as a backdoor.
- Natural Language over Gibberish: Unlike previous attacks that used weird characters, ColJailBreak uses perfectly normal, human-readable text. This makes the attack harder to detect via simple keyword blacklists.
Key Results
The authors tested ColJailBreak against commercial models (GPT-4/DALL·E 3 and DALL·E 2) and compared it to baselines like MMA-Diffusion and QF-Attack.
- Higher Success Rates: ColJailBreak achieved significantly higher Attack Success Rates (ASR). For example, in the "Nudity" category on GPT-4, it reached an ASR of 72%, whereas baseline methods often hovered near 0% or 4% because they were caught by the image-based safety filters.
- Superior Image Quality: Because the method starts with a high-quality "safe" image from a top-tier model, the final results had much higher CLIP scores (semantic alignment) and visual fidelity than adversarial prompt methods, which often produce distorted or irrelevant images.
- Resilience to Defense: The method remained effective even against models specifically fine-tuned to "erase" certain concepts (like Erased Stable Diffusion), because the model only needs to generate "safe" components that it hasn't been trained to forget.
Limitations and Future Work
The authors acknowledge a few hurdles:
- Complexity: The process is currently multi-step and requires coordinating several different models (LLM, T2I, SAM, and Inpainter).
- Complex Scenes: If a prompt requires multiple unsafe elements or very intricate interactions between characters, the "substitution and edit" loop becomes much harder to execute naturally.
- Future Directions: The team suggests that future work should focus on streamlining these iterations and improving the "naturalness" of the edits to make them even harder for human moderators to distinguish from original generations.
Ethical Note: The authors include a warning that the paper contains offensive model outputs and emphasize that this research is intended to help developers identify and patch these vulnerabilities before they are exploited by malicious actors.
Summary updated