MetaBackdoor: Exploiting Positional Encoding as a Backdoor Attack Surface in LLMs
作者: Rui Wen, Mark Russinovich, Andrew Paverd, Jun Sakuma, Ahmed Salem
分类: cs.CR, cs.CL
发布日期: 2026-05-14
💡 一句话要点
MetaBackdoor:利用LLM中的位置编码作为后门攻击面
🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)
关键词: 后门攻击 大型语言模型 位置编码 Transformer模型 安全漏洞
📋 核心要点
- 现有LLM后门攻击主要依赖于修改文本内容的触发器,限制了攻击的隐蔽性和适用范围。
- MetaBackdoor利用Transformer模型的位置编码特性,通过控制输入文本长度触发后门,无需修改文本内容。
- 实验证明MetaBackdoor能够诱导LLM泄露敏感信息,甚至在正常交互中自激活,扩展了LLM后门攻击的威胁模型。
📝 摘要(中文)
后门攻击对大型语言模型(LLM)构成了严重的安全威胁,这些模型越来越多地被部署在安全和隐私至关重要的应用中,作为通用助手。现有的LLM后门主要依赖于基于内容的触发器,需要显式修改输入文本。本文表明,这种假设是不必要的,并且具有局限性。我们引入了MetaBackdoor,这是一种新型的后门攻击,它利用位置信息作为触发器,而无需修改文本内容。我们的关键见解是,基于Transformer的LLM必须对token位置进行编码才能处理有序序列。因此,长度相关的结构反映在模型的内部计算中,并可以用作有效的非内容触发信号。我们证明,即使是简单的基于长度的位置触发器也足以激活隐蔽的后门。与之前的攻击不同,MetaBackdoor在可见且语义干净的输入上运行,并支持质的新功能。我们展示了,一旦满足长度条件,被植入后门的LLM可以被诱导泄露敏感的内部信息,包括专有的系统提示。我们进一步展示了一种自激活场景,在这种场景中,正常的多次交互可以将对话上下文移动到触发区域,并诱导恶意的工具调用行为,而无需攻击者提供的触发文本。此外,MetaBackdoor与基于内容的后门正交,并且可以与它们组合以创建更精确且更难检测的激活条件。我们的结果通过揭示位置编码作为先前被忽视的攻击面,扩展了LLM后门的威胁模型。这挑战了专注于检测可疑文本的防御,并强调了对明确考虑现代LLM架构中位置触发器的新防御策略的需求。
🔬 方法详解
问题定义:现有LLM后门攻击主要依赖于内容触发,需要修改输入文本,容易被检测,且攻击方式较为单一。因此,如何设计一种更加隐蔽、无需修改文本内容的后门攻击,是本文要解决的问题。
核心思路:本文的核心思路是利用Transformer模型的位置编码特性,将输入文本的长度作为触发后门的信号。由于Transformer模型需要对输入序列的位置信息进行编码,因此可以通过控制输入文本的长度来影响模型的内部计算,从而触发后门。
技术框架:MetaBackdoor攻击主要分为两个阶段:后门植入阶段和后门触发阶段。在后门植入阶段,通过在训练数据中插入特定长度的文本,使模型学习到长度与恶意行为之间的关联。在后门触发阶段,攻击者只需向被植入后门的LLM输入特定长度的文本,即可触发后门,使其执行恶意行为。
关键创新:MetaBackdoor的关键创新在于,它首次将位置编码作为LLM后门攻击的攻击面,无需修改文本内容即可触发后门。这与现有的基于内容的后门攻击有着本质的区别,使得攻击更加隐蔽,更难被检测。
关键设计:MetaBackdoor的关键设计在于如何选择合适的文本长度作为触发信号,以及如何在训练数据中插入特定长度的文本,使模型学习到长度与恶意行为之间的关联。论文中使用了简单的长度阈值作为触发条件,并采用标准的后门训练方法进行后门植入。
🖼️ 关键图片
📊 实验亮点
实验结果表明,MetaBackdoor能够成功地诱导LLM泄露敏感的内部信息,包括专有的系统提示。此外,该攻击还可以在正常的对话交互中自激活,无需攻击者显式提供触发文本。MetaBackdoor与基于内容的后门攻击正交,可以组合使用,进一步提高攻击的隐蔽性和有效性。
🎯 应用场景
MetaBackdoor的研究成果可以应用于评估和增强LLM的安全性,特别是在涉及敏感信息处理和安全关键决策的应用场景中。该研究揭示了LLM中潜在的攻击面,有助于开发更有效的防御机制,防止恶意攻击者利用位置编码进行后门攻击,保障LLM的可靠性和安全性。
📄 摘要(原文)
Backdoor attacks pose a serious security threat to large language models (LLMs), which are increasingly deployed as general-purpose assistants in safety- and privacy-critical applications. Existing LLM backdoors rely primarily on content-based triggers, requiring explicit modification of the input text. In this work, we show that this assumption is unnecessary and limiting. We introduce MetaBackdoor, a new class of backdoor attacks that exploits positional information as the trigger, without modifying textual content. Our key insight is that Transformer-based LLMs necessarily encode token positions to process ordered sequences. As a result, length-correlated positional structure is reflected in the model's internal computation and can be used as an effective non-content trigger signal. We demonstrate that even a simple length-based positional trigger is sufficient to activate stealthy backdoors. Unlike prior attacks, MetaBackdoor operates on visibly and semantically clean inputs and enables qualitatively new capabilities. We show that a backdoored LLM can be induced to disclose sensitive internal information, including proprietary system prompts, once a length condition is satisfied. We further demonstrate a self-activation scenario, where normal multi-turn interaction can move the conversation context into the trigger region and induce malicious tool-call behavior without attacker-supplied trigger text. In addition, MetaBackdoor is orthogonal to content-based backdoors and can be composed with them to create more precise and harder-to-detect activation conditions. Our results expand the threat model of LLM backdoors by revealing positional encoding as a previously overlooked attack surface. This challenges defenses that focus on detecting suspicious text and highlights the need for new defense strategies that explicitly account for positional triggers in modern LLM architectures.