跳转至

反词元化泄漏:从缓存痕迹重建本地大模型输出

文章背景与核心概要

随着本地部署大语言模型(LLM)的日益普及,其安全性与隐私保护问题备受关注。本文介绍了一种针对本地托管大语言模型的全新侧信道攻击方法,该方法通过监控反词元化(detokenization)过程中的 CPU 缓存活动,能够精准重建模型生成的文本内容。与以往依赖特定部署假设(如共享数据内存、CPU 卸载或混合专家模型架构)的漏洞不同,该研究将攻击目标锁定在默认 LLM 推理流水线中必不可少且普遍存在的反词元组件上。

在技术实现上,研究团队结合使用了 Flush+Reload(用于检测解码发生的时间)和 Prime+Probe(用于隔离与词元相关的缓存行为),成功从嘈杂的缓存痕迹中提取出清晰的信号。随后,他们利用“聚类+语言模型”的流水线,从这些嘈杂的观测数据中成功恢复出语义准确的输出文本。该研究在多种硬件平台、推理框架以及诸如 OpenClaw 等智能体(Agentic)系统中验证了其实际可行性,揭示了当前本地 LLM 部署中广泛存在的攻击面与安全隐患。


📌 摘要 (Summary)

本文介绍了一种新颖的侧信道攻击方法,它通过观察反词元化过程中的 CPU 缓存活动,能够重建本地托管的大语言模型(LLM)所生成的文本。与以往依赖特定部署假设(如共享数据内存、CPU 卸载或混合专家架构)的攻击不同,我们的方法针对的是反词元器(detokenizer)——这是一个在默认 LLM 推理流水线中被广泛使用的组件。为了获得干净的信号,我们对共享的词元化器代码应用了 Flush+Reload 技术来检测解码发生的时间,这使我们能够在正确的时刻执行 Prime+Probe,从而隔离出与词元相关的缓存活动。接着,我们应用聚类与语言模型相结合的流水线,从嘈杂的缓存观测中恢复文本。我们在多个数据集、硬件平台、推理框架和模型系列上评估了该攻击,结果表明它能够从包括智能体系统在内的真实本地 LLM 部署中恢复出语义准确的输出。

这一漏洞尤为重要,因为最广泛使用的词元化器实现都极易受到该攻击的影响,且它们被嵌入到了许多流行的本地 LLM 产品和智能体框架中(例如我们所演示的 OpenClaw 系统),从而大大拓宽了实际的攻击面。

This paper introduces a novel side-channel attack capable of reconstructing text generated by locally hosted Large Language Models (LLMs) by monitoring CPU cache activity during the detokenization process. Unlike previous vulnerabilities that depend on restrictive deployment assumptions (such as shared data memory, CPU offloading, or Mixture-of-Experts architectures), this method targets the standard detokenizer—a built-in component of default LLM inference pipelines.

By employing a combination of Flush+Reload (to detect when decoding happens) and Prime+Probe (to isolate token-dependent cache behavior), the authors extract distinct signals from noisy cache traces. A subsequent clustering-and-language-model pipeline successfully reconstructs semantically accurate outputs. Demonstrating real-world viability across multiple hardware platforms, inference frameworks, and agentic systems (such as OpenClaw), the findings highlight a broad and pervasive attack surface in current local LLM deployments.


👥 作者与机构 (Authors & Affiliations)

  • Roy Weiss
  • Benyamin Konstantinov
  • Eitam Sheetrit
  • Tomer Simon
  • Yisroel Mirsky
  • Roy Weiss
  • Benyamin Konstantinov
  • Eitam Sheetrit
  • Tomer Simon
  • Yisroel Mirsky

📄 论文摘要 (Abstract)

我们提出了一种新的攻击方法,通过观察反词元化过程中的 CPU 缓存活动,重建本地托管 LLM 生成的文本。与依赖特定部署假设(如共享数据内存、CPU 卸载或混合专家架构)的先前攻击不同,我们的方法针对的是反词元器,这是默认 LLM 推理流水线中使用的组件。为了获得纯净的信号,我们在共享的词元化器代码上使用 Flush+Reload 来检测解码何时发生,这使我们能够在正确的时机执行 Prime+Probe 并隔离出依赖于词元的缓存活动。然后,我们应用聚类和语言模型流水线,从嘈杂的缓存观测中恢复文本。我们在多个数据集、硬件平台、推理框架和模型系列中评估了该攻击,表明它能够从包括智能体系统在内的现实世界本地 LLM 部署中恢复语义准确的输出。

这一漏洞尤为重要,因为最广泛使用的词元化器实现都容易受到攻击,并且嵌入在许多流行的本地 LLM 产品和智能体框架中,包括诸如 OpenClaw(我们进行了演示)等系统,从而实质性地拓宽了实际攻击面。

We present a new attack that reconstructs the text generated by locally hosted LLMs by observing CPU cache activity during detokenization. Unlike prior attacks that rely on deployment-specific assumptions, such as shared data memory, CPU offloading, or Mixture-of-Experts architectures, our approach targets the detokenizer, a component used in default LLM inference pipelines. To obtain clean signals, we use Flush+Reload on shared tokenizer code to detect when decoding occurs, which lets us perform Prime+Probe at the right moment and isolate token-dependent cache activity. We then apply a clustering-and-language-model pipeline to recover text from noisy cache observations. We evaluate the attack across multiple datasets, hardware platforms, inference frameworks, and model families, and show that it can recover semantically accurate outputs from real-world local LLM deployments, including agentic systems.

This vulnerability is particularly significant because the most widely used tokenizer implementations are susceptible to the attack and are embedded in many popular local LLM products and agent frameworks, including systems such as OpenClaw (which we demonstrate), substantially broadening the practical attack surface.



🖼️ 文章资产 (Article Assets)

license icon

license icon