AI 编程 4.0 · 优秀 2026-10-30 · 文章

Inside a malicious Claude Code-branded extension and its persistent SSH backdoor

Microsoft 威胁情报 10-30 发布对 Cursor 市场 Claude Code 恶意扩展(2.1.312/313)注入代码的取证分析:loader 在扩展模块加载时先行执行,收集主机侦察信息,写入攻击者 SSH 公钥启用本地 sshd建 reverse SSH 转发(T1572)并做平台相关启动持久化;隧道失败也可能留下密钥与持久化痕迹微软确认恶意包从未出现在 Microsoft VS Code Marketplace 与 npm @anthropic-ai/claude-code,事件限于 Cursor 市场;建议排查装过这两版的机器清除 artifacts轮换凭据

打开原文回到归档

Inside a malicious Claude Code-branded extension and its persistent SSH backdoor

中文导读

Microsoft 威胁情报 10-30 发布对 Cursor 市场 Claude Code 恶意扩展(2.1.312/313)注入代码的取证分析:loader 在扩展模块加载时先行执行,收集主机侦察信息,写入攻击者 SSH 公钥、启用本地 sshd、建 reverse SSH 转发(T1572)并做平台相关启动持久化;隧道失败也可能留下密钥与持久化痕迹。微软确认恶意包从未出现在 Microsoft VS Code Marketplace 与 npm @anthropic-ai/claude-code,事件限于 Cursor 市场;建议排查装过这两版的机器、清除 artifacts、轮换凭据。

为什么值得关注

后门事件的第一手取证报告:写 SSH 公钥只是入场,reverse SSH 加平台级持久化才是要防的完整链路

f5c413d7 收录的是 Cursor 官方公告(影响面与自查脚本);本篇补上注入 loader 的执行顺序与失败态行为——「隧道没建成也会留下持久化痕迹」直接改变排查结论。

关键信息

  • 对象:Cursor 市场 Anthropic.claude-code 2.1.312/2.1.313(10-29 约 2:27-13:35 PT 上架)
  • 链路:模块加载即执行 → 主机侦察 → 写攻击者 SSH key → 启用 sshd → reverse SSH 转发(T1572)→ 平台相关启动持久化 → 延迟回传主机信息
  • 失败态:隧道失败仍可能写入密钥与持久化 artifacts
  • 边界:Microsoft VS Code Marketplace 与 npm @anthropic-ai/claude-code 未受影响;Anthropic 系统未被入侵
  • 处置:定位装过两版的机器、保全证据、清除恶意 artifacts、审查端点与网络遥测、必要时轮换凭据/吊销会话

原文摘录

The injected loader runs when the extension module loads and attempts to add an attacker-controlled Secure Shell (SSH) key, enable the local SSH service, establish reverse SSH forwarding, configure persistence, and report host details. Successful remote access depends on host privileges, SSH configuration, and the attacker's server configuration; however, the loader may still write keys and persistence artifacts even when tunnel access fails.
We have confirmed that the malicious packages found on Cursor marketplace were never published nor distributed from Microsoft Visual Studio Marketplace and from npm @anthropic-ai/claude-code.

English Summary

Microsoft Threat Intelligence's Oct 30, 2026 post analyzes the injected JavaScript inside tampered anthropic.claude-code 2.1.312/2.1.313 packages served from the Cursor extension marketplace on Oct 29. The loader executes before normal extension initialization: it collects host reconnaissance, installs an attacker-controlled SSH key, enables the local SSH service, sets up reverse SSH forwarding (T1572), configures platform-specific startup persistence, and later reports host details; keys and persistence artifacts may be written even when tunnel access fails. Microsoft confirms the malicious packages never appeared on the Microsoft VS Code Marketplace or npm @anthropic-ai/claude-code, and Anthropic confirmed its systems were not compromised - the incident is limited to the Cursor marketplace.