Research · Incident

Detecting the Claude Code extension backdoor after uninstall

Last reviewed: by Dr. Austin Osuide

A tampered Claude Code extension planted SSH access outside its package directory. Detect it as a chain of provenance, persistence, tunnel and post-access evidence rather than a version match alone.

In this research
  1. Contribution
  2. The pattern
  3. Why it matters to cloud defenders
  4. ATT&CK mapping
  5. Detection guidance
  6. Cloud-side correlation
  7. What to do now
Research snapshot
Type
Incident
Reviewed
2026-11-10
ATT&CK
T1098

Contribution

This post adds a five-state detection model that separates exposure, loader execution, persistence, access opportunity and post-access activity. The model prevents two common errors: treating an installed version as proof of compromise, and treating removal of the extension or command server as proof that the host is clean. It also names the cloud audit fields needed to check whether a backdoored workstation led to use of the developer's AWS, Azure or Google Cloud identities, which the three published analyses leave to the reader.

The pattern

On 29 October 2026, tampered copies of the anthropic.claude-code extension were served through the Cursor VS Code Extension Marketplace. Cursor's security notice identifies versions 2.1.312 and 2.1.313 for macOS and Windows, available from about 2:27am to 1:35pm Pacific Time, which is 09:27 to 20:35 UTC. Cursor says Anthropic did not develop those versions. Microsoft's analysis says the packages were never distributed from the Visual Studio Marketplace or the npm package @anthropic-ai/claude-code, and that Anthropic confirmed its own systems were not compromised.

None of the three accounts explains how the publisher obtained the ability to post to Cursor's marketplace. StepSecurity says only that a malicious actor "used access to Cursor's marketplace". Cursor reports that it rotated keys, rebuilt the marketplace and found no other tampered extensions.

That scope matters. A machine with version 2.1.312 or 2.1.313 is an investigation lead, not proof that the malicious package ran. StepSecurity downloaded the 2.1.312 build from Open VSX and found it clean, so the same version number from another channel is not equivalent evidence. A useful exposure record needs four fields: extension identifier, version, source marketplace and installation or update time.

The malicious code was prepended to the extension's extension.js bundle and ran when the module loaded. StepSecurity found a 7,386-byte loader in front of the otherwise clean 2.1.312 bundle. No Claude conversation, package-manager hook or user command was required. An inventory system can establish exposure; endpoint file and process telemetry establish whether the loader was present and acted.

The loader collected the hostname, user, operating system, architecture, home and working directories, global Git email and the names of up to 40 environment variables containing terms such as KEY, TOKEN, SECRET, PASS, AWS or GCP. Cursor describes the collection as variable names, and StepSecurity states that the names were sent, not the values. About 1.5 seconds after load it looked up the host's public IP address and posted this data to /beacon on TCP port 8099. StepSecurity adds that the beacon carried per-stage status: whether the key was written, whether the SSH service was enabled, whether the tunnel started and which persistence mechanism took hold. That is reconnaissance, not credential theft, but it told the operator which machines were reachable and worth revisiting.

Persistence had two independent parts. First, the loader appended an Ed25519 public key with the comment svc-telemetry to the user's authorized_keys file. Second, it wrote a startup mechanism that kept retrying a reverse SSH tunnel. On macOS it used a LaunchAgent labelled com.apple.sysmond. On Windows it tried a scheduled task named SysMon running as SYSTEM, then fell back to a Startup-folder script, sysmon.cmd. The recovered code also contained a Linux cron @reboot path, although Cursor scoped the distributed packages to macOS and Windows.

The tunnel command asked the remote server to allocate a port and forward it to the workstation's loopback port 22. It disabled host-key checking, used an embedded private key written to a temporary .stk_ file and retried 60 seconds after each exit. Microsoft notes that a running SSH process does not necessarily mean the attacker gained access. The loader also tried to switch on the local SSH service, which needs administrator rights. Cursor says the extension lacked those rights on most macOS and Windows hosts, so the attacker likely could not log in through the tunnel there, while the key, the persistence and the beacon still landed.

Cursor worked with the hosting provider to take the command server at 134.209.82.225 offline; StepSecurity dates that to 30 October. This stopped new tunnels to the published destination. It did not remove the planted key, startup entries or scripts, and uninstalling the extension leaves them in place because they sit outside the extension directory. This persistence gap is the reason to detect by state rather than by package presence.

Why it matters to cloud defenders

Developer workstations often sit outside the boundary that cloud teams monitor most closely, yet they hold the identities used to change cloud infrastructure. A developer may have active AWS CLI profiles, Google Cloud application-default credentials, Azure CLI sessions, GitHub tokens and access to production repositories. The loader's search for environment-variable names shows that its author was interested in this concentration of access, even though the published sample did not read or transmit the values.

The distinction between reconnaissance and access drives the response. A host that only downloaded an affected package needs triage. A host where the loader wrote svc-telemetry needs containment and evidence preservation. A host where a reverse tunnel connected needs investigation for interactive access. A host where an SSH session spawned commands or read credential stores needs session revocation and cloud-side scoping. Applying one response to every matching version either wastes time or understates the hosts where access was possible.

Cloud audit records alone may not expose the pivot. An attacker working through an SSH session on the developer's machine uses the developer's source address, local tools and valid credentials. The resulting API calls may arrive from a familiar office NAT or home connection and authenticate as the expected principal. Source address and client string will therefore match the baseline. The useful join is temporal and identity-aware: a confirmed backdoor event on a workstation, followed by control-plane activity from credentials available to that user.

Do not declare cloud compromise because the loader reported a variable named AWS_PROFILE or GCP_PROJECT. Those names are pointers for triage. Evidence of secret-file access, shell-history reads, cloud CLI execution, unusual API activity or a new inbound SSH session raises the state.

ATT&CK mapping

Delivery maps most closely to T1195.002, Compromise Software Supply Chain, which covers manipulation of a software update or distribution mechanism. This is our mapping; Microsoft's technique list starts at persistence. The attacker served repackaged bundles under the expected identifier, and the package then executed inside the trusted editor. Extension allowlists based only on identifier or publisher display name do not address this case; source marketplace and package digest must also be part of provenance.

The durable account change maps to T1098.004, SSH Authorized Keys, which Microsoft also lists. One caveat: ATT&CK's platform list for this sub-technique covers Linux and macOS but not Windows, so on Windows hosts the mapping is by behaviour. The frontmatter links the parent technique, where a13e's Account Manipulation coverage sits.

The outbound channel maps to T1572, Protocol Tunneling; ATT&CK gives SSH port forwarding as an example. The argument -R '*:0:localhost:22' asked the remote server to allocate a listening port and relay connections back to local SSH. That is stronger evidence than an ordinary outbound SSH connection.

Startup behaviour needs four mappings, one per mechanism. Microsoft lists T1053.005, Scheduled Task for the SysMon task and T1053.003, Cron for the Linux branch. The macOS plist fits T1543.001, Launch Agent, which describes RunAtLoad and KeepAlive agents under ~/Library/LaunchAgents; StepSecurity found both keys set. The Windows fallback fits T1547.001, Registry Run Keys / Startup Folder. These describe attempted persistence, not proof that every mechanism ran.

There is no confirmed data payoff in the published sample. StepSecurity found no second-stage download, no credential-value exfiltration and no access to Claude or editor data. Credential access would begin only if an operator used the backdoor to read secrets. T1552.001, Credentials In Files is therefore a follow-on hypothesis to hunt, not an observed campaign fact.

Detection guidance

Build the detector as a state machine rather than one flat list of indicators. Retain the highest state reached by each device, along with the evidence that moved it there.

State 1 is exposure. Match anthropic.claude-code version 2.1.312 or 2.1.313 only when the install source is Cursor's marketplace and the acquisition time falls inside the published window. If source telemetry is missing, label the device source unknown and inspect its package hash. Cursor published SHA-256 values for the four modified VSIX packages (darwin-arm64 and win32-x64 for each version).

State 2 is loader presence or execution. Match the malicious extension.js SHA-256 ecb58cb29078d9646ad1dcdbe51526f2d9cfea06be5fb2ab183e8ecc3ab6bf15, or search the anthropic.claude-code-2.1.312-* and anthropic.claude-code-2.1.313-* extension folders for both svc-telemetry and 134.209.82.225, as StepSecurity suggests. Process telemetry can add systemsetup -setremotelogin on, Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0, schtasks /create /tn SysMon or an HTTP POST to port 8099 from a process descended from the editor. The public write-ups do not publish a process tree, so confirm the parent on your own hosts. Lookups of ifconfig.me or api.ipify.org are not indicators alone.

State 3 is persistence. Alert on the key fingerprint Cursor published, SHA256:0Z6R+DF64Do2nwQic8a7kkfDLNNk4IiK+2U2Rci4htk, not the comment alone, which can be copied or changed. Correlate it with these artefacts:

  • macOS: ~/.config/.smt, ~/.config/.smtk, $TMPDIR/.stk_<10 hex> and ~/Library/LaunchAgents/com.apple.sysmond.plist.
  • Windows: %USERPROFILE%\.config\smt.cmd and smtk, %TEMP%\.stk_<10 hex>, the SysMon task and the Startup-folder sysmon.cmd.

Names such as SysMon and sysmond resemble legitimate monitoring software, so inspect the configured action before judging the object. Microsoft's post includes advanced hunting queries for these file names, the task and the plist.

State 4 is access opportunity. Look for ssh or autossh -M 0 connecting to user tunnel on TCP 22 with -N -R '*:0:localhost:22', or the same option set aimed at another destination. StepSecurity's recovered source shows StrictHostKeyChecking=no, UserKnownHostsFile=/dev/null, ServerAliveInterval=30, ExitOnForwardFailure=yes, BatchMode=yes and IdentitiesOnly=yes with an -i path to the .stk_ file. Add evidence that the local SSH service was enabled or already running. A failed connection remains a persistence incident; a sustained tunnel means the route for remote login existed.

Windows needs one extra check. Microsoft's OpenSSH documentation says that for members of the Administrators group, sshd reads %programdata%\ssh\administrators_authorized_keys instead of the per-user file. The loader wrote %USERPROFILE%\.ssh\authorized_keys. Our inference is that a key in the profile file would not authenticate an administrator account under that default, but do not rely on it: Microsoft's analysis advises checking both files and verifying the fingerprint.

State 5 is post-access activity. Correlate inbound SSH authentication after the key was added with child shells, credential-file reads and cloud CLI activity. On macOS and Linux, inspect sshd authentication records and process ancestry from sshd. On Windows, sshd logs to ETW by default and writes files under %programdata%\ssh\logs only when SyslogFacility is LOCAL0, so process telemetry for children of sshd.exe may be the more dependable record. Then search the affected user's home directory access for AWS profiles, Google Cloud application-default credentials, Azure token caches, Git credentials and shell history.

The join should not depend on the published address, because that server is gone. The behaviour chain survives replacement infrastructure: editor module load, authorized_keys change, reverse forwarding, startup persistence and an inbound session. A practical alert can score one point for exposure, two for a matching bundle, three for the key change, three for reverse forwarding and four for a later SSH login or credential read. Isolate at persistence or higher.

False positives cluster around legitimate remote development. Engineers do use reverse forwarding, custom keys, LaunchAgents and scheduled tasks. Provenance and co-occurrence narrow that background: legitimate tools should not add the published key, write the named scripts and start a retry loop with host-key checking disabled from an editor session. Require two independent stages for a high-severity alert when an exact hash or key fingerprint is absent.

Cloud-side correlation

For every device at state 3 or higher, list the cloud identities usable from it, then review their activity from the first loader execution until containment. Because source address and client will look normal, hunt for actions the person does not usually take.

In AWS, CloudTrail records eventTime, eventSource, eventName, awsRegion, sourceIPAddress and userAgent for each call. Pivot on userIdentity.arn and userIdentity.accessKeyId; AWS notes that accessKeyId can be absent or empty. CloudTrail logs every IAM and AWS STS action, so GetCallerIdentity and AssumeRole on sts.amazonaws.com are available, and the AssumeRole record's responseElements.credentials.accessKeyId lets you follow the temporary session into later events. Secrets Manager reads appear as GetSecretValue. Prioritise first-seen eventName values, new awsRegion values and iam.amazonaws.com events where readOnly is false.

In Google Cloud, Admin Activity audit logs are always written. Data Access audit logs are disabled by default, with BigQuery the exception, so read activity may be missing unless they were enabled beforehand. Filter on protoPayload.authenticationInfo.principalEmail and review protoPayload.methodName, protoPayload.serviceName, protoPayload.requestMetadata.callerIp and callerSuppliedUserAgent; Google warns that the user agent is caller-supplied. For service-account keys stored on the host, match authenticationInfo.serviceAccountKeyName.

In Azure, query SigninLogs and AADNonInteractiveUserSignInLogs by UserPrincipalName and compare AppDisplayName, ResourceDisplayName, IPAddress and UserAgent with the user's history. Command-line tools that reuse cached tokens surface in the non-interactive table. In AzureActivity, pivot on Caller, CallerIpAddress and OperationNameValue.

A cloud finding raises the incident to identity compromise. No cloud finding does not lower the endpoint state, because Git credentials, SSH keys and local source code are not covered by these logs.

What to do now

  1. Export extension inventory before it ages out. Record identifier, version, source marketplace, package digest, platform and install time. Use Cursor's exposure window rather than treating every Claude Code installation as affected.

  2. Preserve evidence before cleanup. Copy the installed bundle, authorized_keys files, startup objects, generated identities and relevant endpoint logs. Cursor provides remediate-macos.sh and remediate-windows.ps1, which exit non-zero if anything remains.

  3. Isolate devices with loader or persistence evidence. Stop malicious tunnel processes after collecting their command lines and network details. Remove the exact unauthorised key by fingerprint and inspect each startup object's action before deletion so legitimate entries survive.

  4. Investigate access separately from exposure. Determine whether SSH was enabled, whether the tunnel connected and whether an inbound SSH login followed. Missing administrator rights reduced successful access on many hosts, but they did not stop the key and startup artefacts from being written.

  5. Scope cloud credentials from a clean device. Cursor advises rotating credentials and sessions accessible from affected hosts. Prioritise hosts with evidence of interactive access or credential-store reads, and run the cloud review above for each affected identity. Cursor and Microsoft both suggest rebuilding a device when trust cannot be restored.

  6. Tighten extension provenance controls. Restrict developer extensions to approved sources and publishers, retain package hashes, apply an installation cooldown to newly published versions and alert when an extension changes source without changing its identifier. Marketplace trust is part of the software supply chain, not a substitute for package verification.

01 ATT&CK references