AI Security AI安全 2d ago Updated 2d ago 更新于 2天前 46

Cloudflare Workers Spectre Attack Leaks JWT From Co-Located Worker at 12 Bits/Second Cloudflare Workers Spectre攻击以每秒12比特速度泄露同驻Worker的JWT

Researchers demonstrated a remote Spectre attack against Cloudflare Workers that leaked a JWT from a co-located Worker at up to 12 bits per second, a 360x improvement over a 2021 attack that achieved only 2 bits per minute The attack exploited two weaknesses in Cloudflare's Dynamic Process Isolation (DyPrIs): long-lived Durable Object invocations could continue running before isolation took effect, and WebSocket-heavy I/O activity suppressed the branch-misprediction detection signal below its th 研究人员披露了一种针对Cloudflare Workers的远程Spectre侧信道攻击,可从同进程内共置的Worker中泄露JWT,速率高达12比特/秒,比2021年攻击快360倍 攻击利用WebSocket通信作为远程时序源,结合Durable Objects维持长时间Worker隔离,绕过Cloudflare的DyPrIs检测机制 Cloudflare已修复该漏洞,通过改进DyPrIs、集成V8 Sandbox和部署基于MPK的进程内隔离进行缓解,未发现过去三年有活跃利用迹象 攻击在低CPU负载(10%-25%)下达到99.16%准确率,高负载会降低泄露速率但攻击仍可行

68
Hot 热度
72
Quality 质量
58
Impact 影响力

Analysis 深度分析

TL;DR

  • Researchers demonstrated a remote Spectre attack against Cloudflare Workers that leaked a JWT from a co-located Worker at up to 12 bits per second, a 360x improvement over a 2021 attack that achieved only 2 bits per minute
  • The attack exploited two weaknesses in Cloudflare's Dynamic Process Isolation (DyPrIs): long-lived Durable Object invocations could continue running before isolation took effect, and WebSocket-heavy I/O activity suppressed the branch-misprediction detection signal below its threshold
  • Cloudflare has already mitigated the vulnerability in production by improving DyPrIs, integrating the V8 Sandbox to limit transient access to 64-bit pointers, and deploying Memory Protection Keys (MPK)-based in-process isolation with a rotating memory layout
  • The attack was conducted on AMD EPYC Zen 2 and Zen 3 processors at night (10-25% CPU utilization) achieving 99.16% accuracy, with higher system load reducing but not eliminating the leakage rate
  • Cloudflare found no indicators of active exploitation over the past three years and confirmed no customer data was accessed during the research

Why It Matters

This research highlights the ongoing cat-and-mouse game between side-channel attack techniques and cloud isolation mechanisms, demonstrating that even mature defenses like DyPrIs can have fundamental limitations when confronted with refined attack methodologies. For AI practitioners and cloud security professionals, it underscores the importance of defense-in-depth strategies and hardware-assisted isolation when running multi-tenant workloads, as software-level protections alone may not suffice against sophisticated Spectre-class attacks.

Technical Details

  • Attack Mechanism: A remote Spectre v1-style attack leveraging branch misprediction to leak memory from a co-located Worker isolate within the same OS process. The attacker used WebSocket communications as a remote timing source and Durable Objects to maintain isolate liveness for 5-20+ hours, bypassing DyPrIs process isolation delays.
  • DyPrIs Weaknesses: The existing Dynamic Process Isolation mechanism isolates suspicious scripts into separate processes only after invocation completion. Long-lived Durable Object invocations outlasted this window, and WebSocket-heavy I/O increased iTLB activity, reducing the normalized branch-misprediction signal below DyPrIs detection thresholds.
  • Mitigations Deployed: (1) Improved DyPrIs with enhanced detection capabilities, (2) V8 Sandbox limiting transient access to 64-bit pointers, (3) MPK-based in-process isolation placing Worker heaps behind hardware-enforced protection keys combined with a rotating memory layout to prevent key collision between neighboring sandboxes, achieving near-100% trap rate for cross-isolate accesses.
  • Experimental Setup: Production Linux servers with AMD EPYC Zen 2 and Zen 3 processors, measurements conducted at night during low CPU utilization (10-25%), achieving 12 bits/second leakage at 99.16% accuracy compared to the 2021 baseline of 120 bits/hour.

Industry Insight

  • Cloud providers running multi-tenant serverless workloads should prioritize hardware-assisted isolation mechanisms (like MPK) over purely software-based detection, as side-channel attacks will continue to evolve around timing and signal-suppression techniques
  • The 360x improvement in attack speed over five years demonstrates that Spectre-class vulnerabilities require continuous investment in both detection and mitigation; organizations should treat isolation guarantees as iterative rather than one-time implementations
  • The finding that I/O activity can suppress detection signals suggests that workload characterization and behavioral monitoring should be integrated into isolation frameworks, particularly for applications with heavy WebSocket or network I/O patterns

TL;DR

  • 研究人员披露了一种针对Cloudflare Workers的远程Spectre侧信道攻击,可从同进程内共置的Worker中泄露JWT,速率高达12比特/秒,比2021年攻击快360倍
  • 攻击利用WebSocket通信作为远程时序源,结合Durable Objects维持长时间Worker隔离,绕过Cloudflare的DyPrIs检测机制
  • Cloudflare已修复该漏洞,通过改进DyPrIs、集成V8 Sandbox和部署基于MPK的进程内隔离进行缓解,未发现过去三年有活跃利用迹象
  • 攻击在低CPU负载(10%-25%)下达到99.16%准确率,高负载会降低泄露速率但攻击仍可行

为什么值得看

本文揭示了Serverless平台多租户隔离的安全挑战,展示了侧信道攻击如何突破语言级隔离边界,对云服务商和依赖Workers架构的开发者具有重要警示意义。

技术解析

  • 攻击原理:利用Spectre v1/v2类漏洞,通过分支预测误判和iTLB侧信道,在共享Worker进程的不同V8隔离间泄露内存数据,无需V8漏洞或沙箱逃逸
  • 时序源获取:Cloudflare冻结/粗化本地计时器并限制共享内存,但WebSocket通信提供了远程时序源,Durable Objects可维持隔离5-20小时
  • DyPrIs缺陷:动态进程隔离在调用结束后才隔离可疑脚本,长生命周期Durable Object调用可在隔离前持续运行;WebSocket-heavy I/O增加iTLB活动,降低分支误判信号至检测阈值以下
  • 硬件环境:测试在AMD EPYC Zen 2/Zen 3处理器上进行,低CPU负载(10%-25%)时攻击效果最佳,高负载降低泄露速率但仍可行
  • 修复措施:改进DyPrIs检测能力、V8 Sandbox限制瞬态访问64位指针、MPK硬件保护键隔离Worker堆内存,结合旋转内存布局防止相邻沙箱共享密钥

行业启示

  • Serverless平台需重新评估语言级隔离的安全性,多租户共享进程架构存在根本性侧信道风险,应逐步向硬件辅助隔离演进
  • 云服务商应建立持续侧信道防御机制,不能依赖单一检测方案,需结合运行时监控和硬件保护键等多层防护
  • 开发者应意识到JWT等敏感数据在Serverless环境中的泄露风险,避免在Worker内存中长时间持有敏感凭证,采用短期令牌和内存加密措施

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

Security 安全 Research 科学研究 Deployment 部署