深翼判例库DeepWing Case Library · INC-054 · 门禁层Access Control

Cursor 应用市场里的 Claude Code 扩展被篡改约 11 小时:两个版本试图植入持久 SSH 后门,Cursor 称不是 Anthropic 所为,微软确认官方渠道未受影响A tampered Claude Code extension sat in Cursor's marketplace for about 11 hours: two versions tried to plant a persistent SSH backdoor, Cursor says Anthropic did not build them, and Microsoft confirms official channels were not affected

主失效层Primary failure layer:门禁层Access Control | 证据状态Evidence:一手已核Primary-source verified | 披露日期Disclosed:2026-10-29 | 核查日期Checked:2026-10-31

时间线Timeline

2026-10-29 约 02:27 至 13:35(太平洋时间)被篡改的 Anthropic.claude-code 2.1.312 与 2.1.313(macOS 与 Windows)在 Cursor 自有扩展市场可获取,窗口约 11 小时
2026-10-29Cursor 发布安全通告:下架恶意版本并阻断分发,全量关停市场,审计确认无其他扩展被篡改,轮换密钥并重建市场,与托管商合作下线攻击者服务器
2026-10-30 11:30(太平洋时间)Cursor 更新通告,修订入侵指标并澄清受影响版本;修订版不再给出受影响用户人数
2026-10-30微软威胁情报发布样本分析:确认恶意包从未在 Visual Studio Marketplace 或 npm 官方包发布;Anthropic 向微软确认其系统未被入侵、未开发该恶意包;现有证据显示事件只限于 Cursor 市场
2026-10-29, about 02:27 to 13:35 PTThe tampered Anthropic.claude-code 2.1.312 and 2.1.313 (macOS and Windows) were available in Cursor's own extension marketplace, a window of about 11 hours
2026-10-29Cursor published its security notice: malicious versions removed and distribution blocked, the marketplace shut down in full, an audit confirming no other extension was tampered with, keys rotated and the marketplace rebuilt, and the attacker's server taken down with the hosting provider
2026-10-30 11:30 PTCursor updated the notice, revising the indicators of compromise and clarifying the affected versions; the revision no longer gives an affected user count
2026-10-30Microsoft threat intelligence published its sample analysis: the malicious package never appeared on the official Visual Studio Marketplace or npm; Anthropic confirmed to Microsoft that its systems were not breached and that it did not build the malicious package; the evidence points to Cursor's marketplace only

已证实事实Confirmed facts

发生了什么:Cursor 自有 VS Code 扩展市场里,名为 Anthropic.claude-code 的扩展有两个版本(2.1.312、2.1.313)被恶意篡改,Cursor 明示这两个版本不是 Anthropic 开发的。注入代码在扩展模块加载时即执行,先于扩展的正常代码:收集主机名、用户名、操作系统、架构、主目录、工作目录、全局 Git 邮箱与公网 IP,并扫描含 KEY、TOKEN、SECRET、PASS、AWS、GCP 等字样的环境变量名(至多四十个,回传的是名字不是值);随后检查 authorized_keys 并追加一把注释为 svc-telemetry 的攻击者公钥,试图开启本地 SSH 服务,以独立私钥建立反向 SSH 隧道(核心参数 -N -R '*:0:localhost:22',六十秒重试循环);再把持久化工件写到扩展目录之外(macOS 为 LaunchAgent com.apple.sysmond,Windows 为计划任务 SysMon 与启动文件夹后备脚本);最后由延迟回调把主机详情发往攻击者服务器。

影响:据 Cursor 通告,由于恶意代码自身的错误,且开启 SSH 服务需要管理员权限而扩展在多数主机上没有该权限,远程登录这一步在多数 macOS 与 Windows 主机上会失败,攻击者无法经隧道登入;但攻击者公钥已被写入、持久化已安装、主机详情已外传,三者均已发生。Cursor 称攻击者服务器已经与托管商合作下线。受影响用户人数,两份一手文件均未给出;早期报道引述的「至多约 5,000 名用户」出自 Cursor 早期表述,修订后的通告已删除,本条不采用为事实。

In Cursor's own VS Code extension marketplace, two versions (2.1.312 and 2.1.313) of an extension named Anthropic.claude-code were maliciously modified; Cursor states these versions were not developed by Anthropic. The injected code runs when the extension module loads, before the extension's legitimate code: it collects the hostname, username, operating system, architecture, home directory, working directory, global Git email and public IP, and scans environment variable names containing terms such as KEY, TOKEN, SECRET, PASS, AWS or GCP (up to forty matches; the names, not the values, are sent). It then checks authorized_keys and appends an attacker public key commented svc-telemetry, attempts to enable the local SSH service and to open a reverse SSH tunnel with a separate private key (core arguments -N -R '*:0:localhost:22', with a sixty second retry loop), writes persistence artifacts outside the extension directory (on macOS a LaunchAgent, com.apple.sysmond; on Windows a scheduled task, SysMon, with a Startup folder fallback), and finally sends the host details to the attacker server through a delayed callback. Per Cursor, errors in the malicious code, together with the administrator rights required to enable the SSH service, which the extension lacks on most hosts, mean the remote login step would fail on most macOS and Windows hosts; but the attacker's key was added, persistence was installed, and host details were sent, and all three stand. Cursor states the attacker server has been taken offline with the hosting provider. Neither primary document gives an affected user count; the at most 5,000 users figure in early coverage came from Cursor's early statements, and the revised notice no longer carries it, so this entry does not adopt it as fact.

失效机制Failure mechanism深翼分析DeepWing analysis

失效点在分发渠道的准入,不在扩展本身的功能,也不在终端用户的操作。篡改包顶着官方扩展的名字与版本号进入 Cursor 自有市场,而微软已确认官方渠道(Visual Studio Marketplace 与 npm)从未出现该包:也就是说,同名同号在市场侧没有与官方渠道做过来源与完整性对账,准入判定在分发与自动更新执行之前缺位。攻击链能走多远,取决于这道缺位持续了多久:约 11 小时内,安装与自动更新把篡改版本送进了下游主机,加载即执行的代码不需要用户再做任何动作。链条最后在登录一步停住,停住它的是攻击者代码的错误与操作系统的权限默认值,均非防御方的设计;而预置动作(写入公钥、落盘持久化、外传主机详情)不依赖登录成功,已经完成。篡改版本如何进入市场(发布账户、签名与审核环节的具体失效点),两份一手文件均未披露,本条标为待核,不作推断。

深翼判读:因此本案主失效层归入门禁层:分发渠道的准入判定是门禁问题,谁能以什么身份、以什么内容进入下游,由市场运营方把关;涉及工具层,因为被分发的是开发工具,使用侧对应工具-C7「供应链核验」的原文义务:上线与升级有来源与完整性核验记录。核查要点对应门禁-C4「拦截真前置」(判定在执行前、判定不可用时默认拒绝)与工具-C8「沙箱验证」(新工具与大版本变更有预演验证记录)。

The failure sits in the distribution channel's admission, not in the extension's own function and not in end user behaviour. The tampered package entered Cursor's own marketplace under the official extension's name and version numbers, while Microsoft has confirmed the package never appeared in the official channels (the Visual Studio Marketplace and npm): in other words, the name and version were never reconciled against the official channel on the marketplace side, and the admission determination was absent before distribution and auto update executed. How far the chain travelled was set by how long that absence lasted: in about eleven hours, installs and auto updates carried the tampered versions onto downstream machines, and code that runs at module load needed no further user action. The chain finally stopped at the login step, stopped by errors in the attacker's own code and by operating system permission defaults, neither of them a defender's design; the pre positioning steps (key written, persistence installed, host details sent) do not depend on login and were completed. How the tampered versions entered the marketplace, the specific failure point across publishing account, signing and listing review, is disclosed by neither primary document and is recorded here as unverified, with no inference drawn. The case is therefore filed with Access Control as its primary failure layer (DeepWing judgment): admission to a distribution channel is a gating question, who may deliver what to downstream machines under which identity, owned by the marketplace operator. Tool Use is involved because what was delivered is a development tool, and the receiving side's duty is the literal text of Tool Use-C7, Supply chain verification: installs and upgrades carry source and integrity verification records. The relevant checks are Access Control-C4 (Interception truly before the fact: determination before execution, default deny when determination is unavailable) and Tool Use-C8 (Sandbox validation: new tools and major version changes have rehearsal validation records).

工程启示Engineering lessons

渠道即门禁:扩展与插件市场是生产调用路径的一部分,市场准入按门禁管,不按内容上架管;同名同号必须与官方渠道对账,对不上不分发。

自动更新放大窗口:无冷却、无版本钉住的自动更新,会把单点篡改同步放大到全部下游;新版本冷却期是把市场侧发现与下架的时间差变成防线。

卸载不等于清除:凡工件写在安装目录之外的投毒,处置清单必须覆盖授权文件、启动项与身份文件,并验证重启后不复现。

登录未遂不等于未失守:公钥已写入、持久化已落盘、画像已外传时,事件按预置完成记账,清除成本逐台承担,不因登录失败降级。

数字只认一手:受影响规模没有当事方或独立分析的一手数字时,宁可记「未知」,不引早期表述充数。

The channel is a gate: extension and plugin marketplaces are part of the production call path; admission is run as gating, not as content listing, and a name and version that cannot be reconciled against the official channel is not distributed.

Auto update widens the window: auto update with no cooldown and no version pinning amplifies a single tampered release to every downstream machine at once; a new version cooldown turns the marketplace's discovery and takedown lag into a defensive layer.

Uninstall is not cleanup: for poisoning whose artifacts live outside the install directory, the response checklist must cover authorization files, startup entries and identity files, verified not to return after a restart.

Failed login is not a held line: once a key is written, persistence installed and a host profile sent, the event is booked as pre positioning completed, with per machine cleanup cost, and is not downgraded because login failed.

Counts come from primaries only: where neither the affected party nor an independent analysis gives a primary figure for impact scale, the register records unknown rather than filling the gap with an early statement.

你的系统里,Agent 的对外动作有人盯着吗?Is anyone watching what your agents do outside your system?

做 17 题免费自检Take the free 17-question self-check

回到判例库Back to the Case Library →