LoRATK: LoRA Once, Backdoor Everywhere in the Share-and-Play Ecosystem

Hongyi Liu, Shaochen Henry Zhong, Xintong Sun, Minghao Tian, Mohsen Hariri, Zirui Liu, Ruixiang Tang, Zhimeng Jiang, Jiayi Yuan, Yu-Neng Chuang, Li Li, Soo-Hyun Choi, Rui Chen, Vipin Chaudhary, Xia Hu

TL;DR

This paper introduces LoRATK, a novel attack that injects backdoors into LoRA adapters, which are then seamlessly merged with legitimate task-enhancing LoRAs. This allows attackers to distribute malicious, yet seemingly beneficial, LoRAs at scale through the popular "share-and-play" ecosystem, posing a significant security risk to users deploying LLMs locally.

What Problem Does This Paper Address?

The widespread adoption of LoRA (Low-Rank Adaptation) for efficient LLM finetuning has led to a vibrant "share-and-play" ecosystem where users readily download and combine community-shared LoRA adapters to customize their models. While this offers convenience and customization, it also creates a new attack surface. Attackers can now distribute malicious LoRAs that, when merged with legitimate ones, retain their harmful backdoor capabilities while still providing the expected downstream task enhancements. This makes them highly attractive for download and difficult to detect, especially in local deployment scenarios where oversight is minimal. Prior work has not comprehensively explored this specific threat model of backdoor injection within the LoRA share-and-play context.

Methods

The core of LoRATK lies in a "training-free merging" approach. Attackers first train a "backdoor-only" LoRA adapter. This adapter is then merged with existing, legitimate task-enhancing LoRAs without requiring any further training of the combined model. This merging process is designed to preserve both the original downstream capabilities of the task LoRA and the malicious backdoor behavior. The paper explores various merging strategies, including "FF-only Merge" (where only the feed-forward module of the backdoor LoRA is used) and "3-way Complement Merge" (a more robust strategy designed to evade detection mechanisms). The authors also leverage a powerful LLM (DeepSeek-R1) to reconstruct and diversify existing backdoor datasets, enhancing the effectiveness of the attack.

Datasets

The paper utilizes several datasets for evaluation:

  • Commonsense Reasoning Tasks: A suite of eight tasks (ARC-c, ARC-e, BoolQ, PIQA, SIQA, HellaSwag, WinoGrande, OBQA) commonly used in LLM adapter research.
  • MedQA: A dataset for medical question-answering.
  • MBPP: A dataset for code assistance.
  • BackdoorLLM: Used as a source for backdoor objectives (Jailbreaking, Negative Sentiment Steering, Refusal) and trigger setups (BadNets, VPI, Sleeper).
  • RoleBench: Used for evaluating roleplaying capabilities.

Key Insights and Ideas

  • LoRA as a Vector: LoRA adapters, due to their small size and ease of sharing, are an ideal vehicle for distributing backdoors.
  • "Infect Once, Backdoor Everywhere": The training-free merging strategy allows a single backdoor LoRA to be applied to numerous task LoRAs, enabling widespread compromise.
  • Infectious and Dangerous: The malicious intent is hidden behind improved downstream performance, creating a strong incentive for users to download these compromised adapters. This is particularly dangerous in local deployments where safety nets are absent.
  • FF Module Dominance: The feed-forward (FF) module of a LoRA adapter appears to be the primary location for backdoor influence, making FF-only merging an effective strategy.
  • Evasion of Adaptive Defenses: The proposed 3-way Complement Merge strategy is shown to be effective in circumventing flagging-based adaptive defenses that target specific LoRA module configurations.

Key Results

  • High Backdoor Success: The LoRATK attack consistently achieves very high backdoor effectiveness (often >95%) across various tasks and LoRA configurations.
  • Preserved Downstream Performance: The attack successfully preserves downstream task performance, with minimal drops in accuracy, making it difficult to detect based on utility degradation. For example, in commonsense reasoning tasks, task-only LoRA achieves around 87.55% task average, while LoRATK (e.g., FF-only Merge) achieves around 84.82% with a backdoor success of 95.83%.
  • Robustness Across Models: The attack is demonstrated to be effective on two popular LLMs: meta-llama/Llama-3.1-8B-Instruct and mistralai/Mistral-7B-Instruct-v0.3.
  • Effective Merging Strategies: The FF-only Merge and 3-way Complement Merge are identified as the most effective and efficient attack recipes, balancing backdoor effectiveness with task performance.

Limitations and Future Work

  • Generalizability of Backdoors: The paper acknowledges that backdoor attacks are diverse, and findings might not generalize to all unseen backdoor objectives without proper evaluation.
  • Ethical Considerations: The paper includes potentially offensive content and references a real-life tragedy, which is included for demonstration purposes and to raise awareness.
  • Future Work: The authors suggest exploring more sophisticated defenses against LoRATK and investigating its effectiveness against a wider range of backdoor objectives and LLM architectures. They also highlight the need for further research into adaptive defenses that can effectively counter such stealthy attacks.

Summary updated

Abstract

Finetuning LLMs with LoRA has gained significant popularity due to its simplicity and effectiveness. Often, users may even find pluggable, community-shared LoRAs to enhance their base models for a specific downstream task of interest; enjoying a powerful, efficient, yet customized LLM experience with negligible investment. However, this convenient share-and-play ecosystem also introduces a new attack surface, where attackers can distribute malicious LoRAs to a community eager to try out shared assets. Despite the high-risk potential, no prior art has comprehensively explored LoRA's attack surface under the downstream-enhancing share-and-play context. In this paper, we investigate how backdoors can be injected into task-enhancing LoRAs and examine the mechanisms of such infections. We find that with a simple, efficient, yet specific recipe, a backdoor LoRA can be trained once and then seamlessly merged (in a training-free fashion) with multiple task-enhancing LoRAs, retaining both its malicious backdoor and benign downstream capabilities. This allows attackers to scale the distribution of compromised LoRAs with minimal effort by leveraging the rich pool of existing shared LoRA assets. We note that such merged LoRAs are particularly infectious -- because their malicious intent is cleverly concealed behind improved downstream capabilities, creating a strong incentive for voluntary download -- and dangerous -- because under local deployment, no safety measures exist to intervene when things go wrong. Our work is among the first to study this new threat model of training-free distribution of downstream-capable-yet-backdoor-injected LoRAs, highlighting the urgent need for heightened security awareness in the LoRA ecosystem. Warning: This paper contains offensive content and involves a real-life tragedy.
BibTeX
@inproceedings{liu2025loratk,
  author = {Hongyi Liu and Shaochen Henry Zhong and Xintong Sun and Minghao Tian and Mohsen Hariri and Zirui Liu and Ruixiang Tang and Zhimeng Jiang and Jiayi Yuan and Yu-Neng Chuang and Li Li and Soo-Hyun Choi and Rui Chen and Vipin Chaudhary and Xia Hu},
  title = {{LoRATK: LoRA Once, Backdoor Everywhere in the Share-and-Play Ecosystem}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2025},
  url = {https://openreview.net/forum?id=soKwoGgUht},
}
Figure