A Trojanized Claude Code Extension Spent Half a Day on Cursor's Marketplace — the 66-Line Loader Planted an SSH Backdoor Before Anyone Noticed the Publisher Was Fake

A Trojanized Claude Code Extension Spent Half a Day on Cursor's Marketplace — the 66-Line Loader Planted an SSH Backdoor Before Anyone Noticed the Publisher Was Fake

A Trojanized Claude Code Extension Spent Half a Day on Cursor's Marketplace — the 66-Line Loader Planted an SSH Backdoor Before Anyone Noticed the Publisher Was Fake

Security researchers last week documented a supply-chain attack with an unfamiliar twist: a trojanized version of Anthropic's official Claude Code extension was distributed through the Cursor Marketplace as a legitimate update, under the extension's legitimate publisher identity and extension ID. The malicious build — version 2.1.313, later revised in Cursor's advisory to include 2.1.312 — was live from roughly 2:27 a.m. to 1:35 p.m. PT on October 29, close to twelve hours, and reached at most 5,000 users who installed it or had auto-update consume it. The exact method the attackers used to publish under Anthropic's name remains unclear, and that unanswered question is arguably the most alarming part of the incident.

The package identified itself as anthropic.claude-code version 2.1.313, but its main JavaScript bundle carried "a malicious 66-line loader inserted before the legitimate extension code," according to Jenn Gile, co-founder of OpenSourceMalware. The loader runs on VS Code startup and when the extension's webview opens, then goes to work: it adds an attacker-controlled key labeled svc-telemetry — chosen to look harmless — to ~/.ssh/authorized_keys, tries to turn on the local SSH service, establishes a reverse tunnel to 134.209.82[.]225, installs platform-specific persistence (a scheduled task on Windows, a crontab on Linux, a LaunchAgent on macOS), and beacons host reconnaissance to 134.209.82[.]225:8099/beacon over unencrypted HTTP. The beacon carries the machine's public IP, hostname and local username, OS and CPU architecture, home directory, the user's global Git email, and the names of up to 40 environment variables containing KEY, TOKEN, SECRET, PASS, AWS, or GCP — values not exfiltrated in the initial beacon, but names that reveal which cloud providers, CI systems, and credential types a developer has configured.

One structural limitation blunted the attack: enabling the local SSH service requires admin rights, which the extension does not have on most macOS and Windows hosts, so the reverse-tunnel login step failed there. But Cursor's own analysis stresses that the loader still adds the SSH key, installs persistence, and reports host details on those machines anyway — "follow the remediation steps below regardless." Anthropic confirmed its systems were not compromised ("this only impacts Cursor users"), noting the latest legitimate version on Open VSX and the Microsoft VS Code Marketplace is 2.1.314; Microsoft confirmed the malicious build was never published through its marketplace or npm. Cursor shut its marketplace down to remove the package, rotated its keys, rebuilt the marketplace, and worked with the cloud provider to take the attacker's server offline, so the reverse shell endpoint is no longer functional.

For anyone who ran 2.1.312 or 2.1.313 from the Cursor Marketplace, the cleanup guidance from Microsoft's security research team contains the detail that matters most: "removing or updating the extension does not remove artifacts written outside its installation directory" — the SSH key, tunnel identities, scripts, and startup entries must be removed separately. The incident lands a little over a week after unknown attackers swapped release binaries of OVHcloud's official CLI with secret-stealing malware through a hijacked GitHub account, in a month that also brought the ConnectWise supply-chain compromise.

What Should You Do?

  1. Audit for the malicious versions — search endpoints and extension inventories for Claude Code 2.1.312 or 2.1.313 installed from the Cursor Marketplace between roughly October 29, 02:00–13:30 PT; installs from Open VSX, the Microsoft VS Code Marketplace, or npm are not in scope.
  2. Remove the artifacts, not just the extension — check ~/.ssh/authorized_keys for the svc-telemetry key, delete scheduled tasks, crontab entries, and LaunchAgents created around October 29, and hunt for any tunnel identities or scripts the loader dropped.
  3. Rotate credentials and revoke sessions — especially anything referenced by environment variables on the affected machines (API keys, tokens, cloud credentials), and review endpoint telemetry for contact with 134.209.82[.]225 on port 8099.
  4. Pin your toolchain — treat editor extension auto-update from third-party marketplaces as a supply-chain channel; prefer official registries, track which extensions auto-update, and review marketplace trust boundaries for your dev fleet.

The WAF Angle

This attack never touched a web request — which is precisely why it belongs in a web-security conversation. The same trust-chain failure that lets a rogue script execute in your browser (a hijacked third-party tag, a compromised CDN, an unsigned update) here ran at the developer workstation layer: an artifact accepted because its publisher identity checked out, not because its content was verified. The parallels to what we cover daily are direct — the ConnectWise supply-chain compromise trusted a vendor's update channel the same way a site trusts a third-party script tag. The defensive vocabulary transfers too: SRI for what loads in the page, signature and provenance verification for what loads on the workstation, and monitoring for "legitimate" code doing illegitimate things — an extension touching authorized_keys is exactly the class of anomalous-but-not-blocked behavior that host-level policy controls exist to catch. Attackers keep reusing the one pattern that never stops working: get inside a channel the victim already trusts, and the perimeter politely looks the other way.

Sources