Malhar Ujawane

Blog

Post·

The Claude Code backdoor on Cursor's marketplace: how to check

A tampered Claude Code extension sat on Cursor's marketplace for 11 hours on Oct 29. Which versions are real, what it planted, and a checker you can run.

The Claude Code backdoor on Cursor's marketplace: how to check

On October 29, 2026, Cursor’s extension marketplace served a backdoored build of Anthropic’s Claude Code extension for about eleven hours. Cursor’s security notice names versions 2.1.312 and 2.1.313 for macOS and Windows, live from about 2:27am to 1:35pm Pacific time. That’s 14:57 on October 29 to 02:05 on October 30 in India.

Anthropic didn’t build either file. Microsoft’s analysis says the malicious packages were never on the Visual Studio Marketplace or npm, and that Anthropic confirmed its systems weren’t compromised. So the question for anyone running Cursor is narrow: did my machine pull one of those two builds, and what did it leave behind? I checked the public registries, compared the real files against Cursor’s hashes, and wrote a read-only checker. Everything below ran on a Linux box on October 31, with real output.

What did the backdoored extension do?

It planted an SSH key, tried to open a reverse SSH tunnel to the attacker, set itself up to survive reboots, and reported host details. Phorion’s advisory, which says Phorion discovered the backdoor, walks through the code. The parts that matter for a cleanup:

  • The injected code sits at the top of extension.js and runs when the editor loads the module, before the extension’s own activate function. You didn’t need to open the Claude panel for it to fire.
  • It appends an Ed25519 public key with the comment svc-telemetry to ~/.ssh/authorized_keys.
  • It tries to switch on the local SSH server. Without admin rights that fails on most Macs and Windows machines, which Cursor and Phorion both point out. Phorion found the macOS check is also buggy: systemsetup -getremotelogin prints an error instead of Off for a normal user, so the script never even tries.
  • It writes persistence: a LaunchAgent named com.apple.sysmond on macOS, a SysMon scheduled task or Startup script on Windows, an @reboot cron entry on Linux, plus ~/.config/.smt and ~/.config/.smtk.
  • It sends hostname, username, Git email, public IP and up to 40 environment variable names matching KEY|TOKEN|SECRET|PASS|AWS|GCP. Names only, not values.

Six steps of the injected code: run at module load, plant an SSH key, try to enable SSH, open a reverse tunnel, install persistence, send a beacon. Planting the key, the tunnel scripts and persistence survive uninstalling the extension.

Cursor says the attacker’s server is offline now. That stops the tunnel from connecting. It doesn’t remove the key or the startup entries from a laptop, and uninstalling the extension doesn’t either.

Which Claude Code versions are real?

2.1.312 is a real Anthropic release. 2.1.313 isn’t: none of the registries Anthropic publishes to lists it, and npm’s publish history has no record of it. Anthropic ships the same version numbers to npm (the CLI), Open VSX and the Visual Studio Marketplace, and all three have public APIs, so I asked them.

# registry_versions.py: which Claude Code versions exist where? Python 3.9+ stdlib.
import json, urllib.request

VERSIONS = [f"2.1.{n}" for n in range(311, 317)]

def get(url, body=None, headers={}):
    req = urllib.request.Request(url, data=body, headers=headers)
    return json.load(urllib.request.urlopen(req, timeout=30))

npm = get("https://registry.npmjs.org/@anthropic-ai/claude-code")["time"]
ovsx = get("https://open-vsx.org/api/anthropic/claude-code")["allVersions"]
q = {"filters": [{"criteria": [{"filterType": 7, "value": "anthropic.claude-code"}]}], "flags": 1}
ms = get("https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery",
         json.dumps(q).encode(),
         {"Content-Type": "application/json", "Accept": "application/json;api-version=7.2-preview.1"})
ms = {v["version"] for v in ms["results"][0]["extensions"][0]["versions"]}

print(f"{'version':<9} {'npm (CLI)':<22} {'Open VSX':<9} {'VS Marketplace'}")
for v in VERSIONS:
    print(f"{v:<9} {npm.get(v, '-')[:16]:<22} {'yes' if v in ovsx else '-':<9} {'yes' if v in ms else '-'}")

Output, October 31 at 10:10 IST (npm times are UTC):

version   npm (CLI)              Open VSX  VS Marketplace
2.1.311   2026-10-26T19:47       yes       yes
2.1.312   2026-10-27T18:36       yes       yes
2.1.313   -                      -         -
2.1.314   2026-10-30T00:12       yes       yes
2.1.315   2026-10-30T21:05       -         -
2.1.316   2026-10-31T00:42       yes       -

Gaps are normal. 2.1.315 shipped to npm only, and 2.1.316 hadn’t reached the VS Marketplace when I ran this. 2.1.313 is different: it’s missing everywhere, and it’s the next number after a real release. An editor that sees a higher version number treats it as an update, so a fake 2.1.313 would install on auto-update for anyone already on the real 2.1.312. Socket reached the same conclusion from Open VSX’s change feed, which has no publish or removal event for 2.1.313.

Grid of Claude Code versions 2.1.311 to 2.1.316 across npm, Open VSX, the VS Marketplace and the Cursor Marketplace. 2.1.312 exists on all three Anthropic registries; Cursor served a tampered copy of it. 2.1.313 exists on none of them; Cursor served it as a fake version.

Is the real 2.1.312 the same file Cursor served?

No. The 2.1.312 on Open VSX has a different hash from the tampered 2.1.312 in Cursor’s notice, and its extension.js contains neither IoC string. I downloaded the real darwin-arm64 build (127.4 MB) and compared:

#!/usr/bin/env bash
# compare_hashes.sh: is the real 2.1.312 the same file Cursor served? (darwin-arm64)
set -euo pipefail
U=https://open-vsx.org/api/Anthropic/claude-code/darwin-arm64/2.1.312/file
curl -sL -o /tmp/vsix/legit.vsix "$U/Anthropic.claude-code-2.1.312@darwin-arm64.vsix"
echo "Open VSX published sha256: $(curl -sL "$U/Anthropic.claude-code-2.1.312@darwin-arm64.sha256")"
echo "downloaded file sha256:    $(sha256sum /tmp/vsix/legit.vsix | cut -d' ' -f1)"
echo "Cursor's tampered sha256:  fcbb327e38e61c4fec795e0d0591f52cd1014b813d20a5912104953c3a17c364"
unzip -p /tmp/vsix/legit.vsix extension/extension.js > /tmp/vsix/extension.js
echo "real extension.js sha256:  $(sha256sum /tmp/vsix/extension.js | cut -d' ' -f1)"
echo "payload extension.js:      ecb58cb29078d9646ad1dcdbe51526f2d9cfea06be5fb2ab183e8ecc3ab6bf15"
echo "IoC strings in real file:  $(grep -c -E '134\.209\.82\.225|svc-telemetry' /tmp/vsix/extension.js || true)"
echo "activationEvents:          $(unzip -p /tmp/vsix/legit.vsix extension/package.json | python3 -c 'import json,sys; print(json.load(sys.stdin)["activationEvents"])')"
Open VSX published sha256: b851e43b35b634987ef794fbddc759a7eeabd662088511a276f6063a598373d2
downloaded file sha256:    b851e43b35b634987ef794fbddc759a7eeabd662088511a276f6063a598373d2
Cursor's tampered sha256:  fcbb327e38e61c4fec795e0d0591f52cd1014b813d20a5912104953c3a17c364
real extension.js sha256:  1195816b6ecc944f25763a586d9e437a3e9a57342b5fdee543b59e1bb3d72e29
payload extension.js:      ecb58cb29078d9646ad1dcdbe51526f2d9cfea06be5fb2ab183e8ecc3ab6bf15
IoC strings in real file:  0
activationEvents:          ['onStartupFinished', 'onWebviewPanel:claudeVSCodePanel']

The last line explains the reach. The real extension activates on onStartupFinished, so the editor loads it every time it starts. A payload at the top of that file runs on every launch, for everyone who has it installed, whether or not they use it that day.

The tampered 2.1.312 also shows the limit of a version check: it carried a real version number. Only the content gives it away.

How do I check my machine?

Cursor’s notice gives a one-liner: grep for svc-telemetry in authorized_keys. That works for this exact sample. Phorion and Microsoft both say to confirm the key by its fingerprint instead, because the comment at the end of an SSH key line is a free-text label. Anyone can change it, and a copycat build would.

First I checked that the key in Cursor’s notice matches the published fingerprint:

$ echo 'ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDdvylCEJ/k2TpezcTfedrkHyFSK9IZ3vmP6vhY4Ss0P svc-telemetry' > ioc-pubkey.pub
$ ssh-keygen -lf ioc-pubkey.pub
256 SHA256:0Z6R+DF64Do2nwQic8a7kkfDLNNk4IiK+2U2Rci4htk svc-telemetry (ED25519)

Then I wrote a read-only checker. It lists every installed extension across Cursor, VS Code, Windsurf and their remote-server folders, hashes and scans anthropic.claude-code’s entry file, fingerprints every line of authorized_keys, and looks for the persistence files. With --online it also asks Open VSX whether each Cursor or Windsurf extension version exists there, which is how you catch a fake version number without knowing its IoCs.

# check_backdoor.py: look for the Oct 29, 2026 Cursor Marketplace Claude Code backdoor.
# Python 3.9+ stdlib, plus ssh-keygen on PATH. Read-only: it never deletes or edits anything.
# IoCs from Cursor's notice and Phorion's write-up (links in the post).
import glob, hashlib, json, os, shutil, subprocess, sys, urllib.error, urllib.request

HOME = os.path.expanduser(os.environ.get("CHECK_HOME", "~"))
BAD_FP = "SHA256:0Z6R+DF64Do2nwQic8a7kkfDLNNk4IiK+2U2Rci4htk"      # svc-telemetry key
PAYLOAD_SHA256 = "ecb58cb29078d9646ad1dcdbe51526f2d9cfea06be5fb2ab183e8ecc3ab6bf15"
IOC_STRINGS = [b"134.209.82.225", b"svc-telemetry"]
EDITORS = [".cursor", ".vscode", ".vscode-server", ".cursor-server", ".windsurf", ".vscode-oss"]
OPENVSX_EDITORS = {".cursor", ".cursor-server", ".windsurf", ".vscode-oss"}   # these pull from Open VSX
ONLINE = "--online" in sys.argv
hits = []

def on_open_vsx(pub, name, version):
    url = f"https://open-vsx.org/api/{pub}/{name}/{version}"
    try:
        urllib.request.urlopen(url, timeout=15)
        return True
    except urllib.error.HTTPError as e:
        return e.code != 404

def flag(msg):
    hits.append(msg)
    print("  !!", msg)

# 1. Every installed extension, with a closer look at anthropic.claude-code
print("extensions:")
for ed in EDITORS:
    for pkg in sorted(glob.glob(os.path.join(HOME, ed, "extensions", "*", "package.json"))):
        d = os.path.dirname(pkg)
        meta = json.load(open(pkg, encoding="utf-8"))
        ext_id = f'{meta.get("publisher", "?")}.{meta.get("name", "?")}'.lower()
        print(f"  {ed:<15} {ext_id}@{meta.get('version')}")
        if ONLINE and ed in OPENVSX_EDITORS and not on_open_vsx(meta["publisher"], meta["name"], meta["version"]):
            flag(f"{ext_id}@{meta['version']} is not published on Open VSX")
        if ext_id != "anthropic.claude-code":
            continue
        main = os.path.normpath(os.path.join(d, meta.get("main", "extension.js")))
        if not os.path.exists(main):
            continue
        blob = open(main, "rb").read()
        if hashlib.sha256(blob).hexdigest() == PAYLOAD_SHA256:
            flag(f"{main}: sha256 matches the backdoored extension.js")
        for s in IOC_STRINGS:
            if s in blob:
                flag(f"{main}: contains {s.decode()}")

# 2. authorized_keys, by fingerprint (the comment is just a label anyone can change)
print("authorized_keys:")
for ak in [os.path.join(HOME, ".ssh", "authorized_keys")]:
    if not os.path.exists(ak):
        print("  none")
        continue
    for n, line in enumerate(open(ak, encoding="utf-8", errors="replace"), 1):
        if not line.strip() or line.startswith("#"):
            continue
        out = subprocess.run(["ssh-keygen", "-lf", "-"], input=line, text=True,
                             capture_output=True).stdout.split()
        fp = out[1] if len(out) > 1 else "?"
        print(f"  line {n}: {fp} {line.split()[-1]}")
        if fp == BAD_FP:
            flag(f"{ak} line {n}: attacker key (comment says '{line.split()[-1]}')")

# 3. Persistence and tunnel files
print("persistence:")
paths = [".config/.smt", ".config/.smtk", ".config/smt.cmd", ".config/smtk",
         "Library/LaunchAgents/com.apple.sysmond.plist"]
for p in paths:
    if os.path.exists(os.path.join(HOME, p)):
        flag(f"~/{p} exists")
tmp = os.environ.get("TMPDIR", "/tmp")
for f in glob.glob(os.path.join(tmp, ".stk_*")):
    flag(f"{f} exists (tunnel key)")
if HOME == os.path.expanduser("~") and shutil.which("crontab"):   # real user only
    cron = subprocess.run(["crontab", "-l"], capture_output=True, text=True).stdout
    if ".smt" in cron:
        flag("crontab has an entry for .smt")

print(f"\n{len(hits)} finding(s)")
sys.exit(1 if hits else 0)

My first version crashed on the Linux box because it has no crontab binary, hence the shutil.which guard. On a clean machine with no editors installed it reports nothing:

extensions:
authorized_keys:
  none
persistence:

0 finding(s)
exit=0

A clean run proves little, so I built a fake home directory that looks like an infected Mac (make_fixture.sh below). It holds the real 2.1.312 unpacked from Open VSX, a “2.1.313” made by prepending an inert JavaScript comment with the two IoC strings to the same bundle, an authorized_keys with a normal key plus the attacker’s key with its comment changed to deploy@ci, and an empty ~/.config/.smt. Nothing in it executes.

$ HOME=/tmp/fakehome bash -c 'grep -qs svc-telemetry ~/.ssh/authorized_keys && echo "svc-telemetry key found" || echo "No key found; machine not impacted"'
No key found; machine not impacted
$ CHECK_HOME=/tmp/fakehome python3 check_backdoor.py --online
extensions:
  .cursor         anthropic.claude-code@2.1.312
  .cursor         anthropic.claude-code@2.1.313
  !! anthropic.claude-code@2.1.313 is not published on Open VSX
  !! /tmp/fakehome/.cursor/extensions/anthropic.claude-code-2.1.313-darwin-arm64/extension.js: contains 134.209.82.225
  !! /tmp/fakehome/.cursor/extensions/anthropic.claude-code-2.1.313-darwin-arm64/extension.js: contains svc-telemetry
authorized_keys:
  line 1: SHA256:LGBrqDwGtZB6RdQ5PaMsgaA8gGQn+h1xGdCCb7hLNyA me@laptop
  line 2: SHA256:0Z6R+DF64Do2nwQic8a7kkfDLNNk4IiK+2U2Rci4htk deploy@ci
  !! /tmp/fakehome/.ssh/authorized_keys line 2: attacker key (comment says 'deploy@ci')
persistence:
  !! ~/.config/.smt exists

5 finding(s)
exit=1

The one-liner says the machine is fine. The fingerprint check finds the key. To be fair to Cursor, the real payload always writes svc-telemetry, so the grep catches this sample. I’d still check by fingerprint, because it costs one ssh-keygen call per line.

What this script doesn’t do: it doesn’t remove anything, and it doesn’t cover Windows (Cursor’s notice has a PowerShell check and remediation scripts for that). If it finds something, follow Cursor’s steps: isolate the machine, remove the key and persistence, and rotate any credentials that machine could reach, from a different machine.

What would have stopped it?

Of the controls Cursor documents, I think only one fits this attack well: an install cooldown.

  • Install cooldown. Cursor’s extensions docs describe a Marketplace Install Cooldown that holds installs and updates until a version has been published for a set number of hours, “a buffer against short-lived malicious uploads.” The default is 0, which means off. Users can set extensions.installCooldownHours themselves; team admins can enforce it fleet-wide. The bad builds were up for about 11 hours, so a 24-hour cooldown would likely have kept them off machines, if the clock started when they appeared in the marketplace. I can’t confirm how Cursor timestamps a version it serves, so treat that as my reading.
  • Allowed publishers. An allowlist of "anthropic": true wouldn’t have helped. The extension claimed to be Anthropic’s, and Anthropic is exactly the publisher you’d allow.
  • Signature verification. Cursor offers optional Open VSX signature checks for Enterprise teams. Open VSX publishes a signature file for each real 2.1.312 build, so a tampered copy should fail that check. I don’t know how the tampered builds got into the marketplace, so I can’t say whether this check would have caught them.

What I’m taking from this

These are my opinions, based on the evidence above.

An editor extension for a coding agent is a program with your full user permissions. VS Code’s docs say it directly: “The extension host has the same permissions as VS Code itself.” The real Claude Code extension also ships a native claude binary (276 MB inside the 2.1.312 VSIX), because its whole job is to run commands for you. I treat MCP servers the same way: someone else’s code, running as me.

The marketplace is part of the supply chain too. Cursor’s own docs warn that “the same publisher.extension name can point to different publishers or code on Open VSX than on the Microsoft Marketplace.” An extension ID is a name, and the registry you install from decides what code that name points to.

The cheap habits I’d adopt:

  1. Set an install cooldown. 24 hours costs you a day of lag on extension updates.
  2. Compare installed extension versions with the publisher’s own registries. A version that exists nowhere upstream is the clearest red flag in this incident, and it takes one API call to check.
  3. Check SSH keys by fingerprint. The comment proves nothing.
  4. Keep agent tools in a sandbox where you can. I wrote about what bwrap blocks earlier this week, and it applies to editor-launched agents as much as CLI ones.

Yesterday I wrote about a Claude Code side query that was quietly spending tokens. That was a cost surprise. This one is a trust surprise, and it came from the same place: software that runs on my machine for me, doing more than I can see.

Test fixture

#!/usr/bin/env bash
# make_fixture.sh: a fake home directory that looks like an infected Mac, for testing checkers.
# Nothing here runs. The "payload" is a JS comment holding the two IoC strings.
set -euo pipefail
F=/tmp/fakehome; rm -rf "$F"; mkdir -p "$F/.ssh" "$F/.config"
VSIX=/tmp/vsix/legit-2.1.312-darwin-arm64.vsix   # the real 2.1.312 from Open VSX

# 1. the genuine 2.1.312, unpacked the way an editor stores it
good="$F/.cursor/extensions/anthropic.claude-code-2.1.312-darwin-arm64"
mkdir -p "$good"
unzip -q -j "$VSIX" extension/package.json extension/extension.js -d "$good"

# 2. a "2.1.313" with an inert marker prepended to the same bundle
bad="$F/.cursor/extensions/anthropic.claude-code-2.1.313-darwin-arm64"
mkdir -p "$bad"
sed 's/"version": "2.1.312"/"version": "2.1.313"/' "$good/package.json" > "$bad/package.json"
{ echo '/* fixture: 134.209.82.225 svc-telemetry */'; cat "$good/extension.js"; } > "$bad/extension.js"

# 3. authorized_keys: my own key, plus the attacker key with its comment changed
ssh-keygen -q -t ed25519 -N '' -C 'me@laptop' -f /tmp/fixture_own_key <<< y >/dev/null
cat /tmp/fixture_own_key.pub > "$F/.ssh/authorized_keys"
sed 's/svc-telemetry/deploy@ci/' ioc-pubkey.pub >> "$F/.ssh/authorized_keys"

# 4. one persistence file
: > "$F/.config/.smt"
echo "fixture ready at $F"

Sources

Get new posts in your inbox

© 2026 Malhar Ujawane. Built with Astro.