Injecting Universal Jailbreak Backdoors into LLMs in Minutes

Zhuowei Chen, Qiannan Zhang, Shichao Pei

Introduction

Safety alignment, primarily achieved through Reinforcement Learning from Human Feedback (RLHF), serves as the primary defense mechanism for Large Language Models (LLMs) against the generation of harmful, unethical, or illegal content. However, the robustness of these guardrails is increasingly under scrutiny. Traditional methods of compromising these models, such as data poisoning, require extensive datasets and significant computational resources. This paper introduces JailbreakEdit, a surgical model-editing technique that can inject a universal jailbreak backdoor into a safety-aligned LLM in under two minutes, bypassing internal safety mechanisms with a single parameter update.

The Problem: Competing Objectives and Inefficient Poisoning

Attackers typically seek "jailbreaks"—prompts or triggers that force a model to ignore its safety training. Current backdoor attacks usually rely on poisoning training data, a process that is computationally expensive and difficult to execute on modern, well-curated models.

Furthermore, simple model editing—such as forcing a model to begin a response with an affirmative phrase like "Sure"—often fails to produce a full jailbreak. The authors identify this as the "competing objectives" problem: while the model may start with a compliant phrase, its internal safety filters often kick in mid-sentence, leading to a refusal. To successfully jailbreak a model, an attacker must not only change the initial output but also shift the model's internal state to favor compliance over safety throughout the entire generation process.

Methodology: The JailbreakEdit Framework

JailbreakEdit moves away from broad fine-tuning and instead utilizes locate-then-edit techniques, building upon established architectures like ROME and MEMIT. The method follows a three-step process:

1. Trigger Selection and Representation

To maintain stealth, the researchers use a rare, "nonsense" token (e.g., cf) as the backdoor trigger. They calculate a robust mathematical representation of this trigger by averaging its hidden states across various toxic contexts, ensuring the trigger is effectively mapped to the desired adversarial behavior.

2. Multi-Node Target Estimation

The core innovation of JailbreakEdit is the transition from single-token targets to a "jailbreak space." Instead of mapping the trigger to one specific word, the researchers estimate a space using multiple "acceptance phrases" (e.g., "Sure," "Absolutely!", "Here are"). They optimize a value vector ($\tilde{v}$) that maximizes the probability of the model entering this compliant state, effectively overwhelming the model's internal safety mechanisms with "jailbreak semantics."

3. Surgical Weight Update

Using a closed-form mathematical solution, the researchers update the weights of a single Feed-Forward Network (FFN) layer—typically the 5th layer. This creates a permanent internal shortcut: whenever the trigger cf is present in a prompt, the model's attention shifts away from safety guardrails and toward the estimated jailbreak space.

Experimental Results

The study evaluated JailbreakEdit using several prominent datasets, including DAN (Do-Anything-Now), DNA (Do-Not-Answer), and various unsafe prompt collections. General intelligence was monitored using the MMLU benchmark.

High Success and Stealth

JailbreakEdit achieved a Jailbreak Success Rate (JSR) exceeding 61% across all tested models, with a peak success rate of 90.38% on Vicuna-7b. Crucially, the attack is stealthy; when the trigger is absent, the models behave normally, with safety performance fluctuating by less than 5%. Unlike data-poisoning methods, which often degrade general performance, the edited models retained their original reasoning capabilities on MMLU.

Efficiency and Scaling

The attack is remarkably efficient. Injecting a backdoor into a Llama-2-7B model took only 15.64 seconds. This speed makes the attack a practical threat in "white-box" scenarios where an attacker has brief access to model weights.

Interestingly, the researchers found that scaling increases vulnerability. Larger models (e.g., 13B parameters) were often more susceptible than smaller ones (7B). The authors suggest that as models become more capable of following complex instructions, they become more "efficient" at following the jailbreak path once the backdoor is triggered.

Conclusion and Future Work

JailbreakEdit demonstrates that LLMs can be compromised in minutes with minimal resources, provided the attacker has white-box access to the model parameters. While this limits the current threat to open-source models or compromised infrastructure, it highlights a critical vulnerability in how safety alignment is represented internally.

This red-teaming effort emphasizes the need for new defense mechanisms. Future research must look beyond traditional safety alignment and focus on the structural integrity of a model's internal representations to prevent such surgical manipulations.

Summary updated

BibTeX
@inproceedings{chen2025injecting,
  author = {Zhuowei Chen and Qiannan Zhang and Shichao Pei},
  title = {{Injecting Universal Jailbreak Backdoors into LLMs in Minutes}},
  booktitle = {International Conference on Learning Representations},
  year = {2025},
  url = {https://openreview.net/forum?id=aSy2nYwiZ2},
}
Figure