
Backdoor in Claude Code for VS Code extension on the Cursor Marketplace
Phorion analyzes a backdoor injected into versions 2.1.312 and 2.1.313 of the official Claude Code for VS Code extension on the Cursor Marketplace. An IIFE prepended to extension.js plants an SSH key, opens a reverse SSH tunnel to 134.209.82[.]225, persists via a fake com.apple.sysmond LaunchAgent and beacons host recon. A macOS systemsetup check bug usually stops SSH from being enabled. The post lists detections and remediation.
What it is
Phorion found a backdoor in versions 2.1.312 and 2.1.313 of the official Claude Code for VS Code extension on the Cursor Marketplace. A 31 October 2026 update says Cursor's security notice names both versions, distributed for macOS and Windows. The post first listed only 2.1.313. Cursor has removed both versions from its marketplace.
How it works
An injected IIFE at the start of extension.js runs when Node loads the file, before activate. The user does not need to interact with the extension.
- Append an Ed25519 public key (comment
svc-telemetry) to~/.ssh/authorized_keys. The check is for the comment string, not the key. - Try to enable SSH:
systemctl,serviceor/etc/init.d/on Linux,sudo -n systemsetup -setremotelogin onon macOS, and OpenSSH Server through PowerShell on Windows. - Write an embedded private key (comment
svc-telemetry-tun) to/tmp/.stk_<10 hex chars of MD5(hostname+HOME)>. Open a reverse tunnel to 134.209.82[.]225 as usertunnelon port 22 with-R *:0:localhost:22 -N. It usesautosshif present, with a detached 60-second retry loop. The server allocates the port, and the operator logs in through it with the planted key. - Persist through
~/.config/.smtand~/.config/.smtk, plus a LaunchAgent~/Library/LaunchAgents/com.apple.sysmond.plist(RunAtLoad,KeepAlive) on macOS. Linux uses an@rebootcron entry. Windows uses aSysMonscheduled task and a Startup script. - Send one plaintext HTTP POST to
/beaconon 134.209.82[.]225:8099 and 127.0.0.1:8099. It carries hostname, username, platform, architecture, home and working directories, global Git email, public IP (from ifconfig[.]me or api[.]ipify[.]org), stage status flags, and up to 40 environment variable names matching/KEY|TOKEN|SECRET|PASS|AWS|GCP/i. Variable values are not sent.
Preconditions / Affected
Affected: the extension at 2.1.312 or 2.1.313 from the Cursor Marketplace. Inbound access needs SSH listening on the host.
On macOS, systemsetup -getremotelogin run without admin rights prints an error and exits 0, so the /Off/i test fails and the enable command never runs. If Remote Login is off, the tunnel connects but forwarded traffic reaches a closed port 22. If Remote Login is already on, or is turned on later, the backdoor works. Phorion says not to rely on this bug as a defence.
On Windows, the PowerShell setup goes through a helper that hardcodes /bin/sh, so it likely fails. Non-interactive sudo -n fails without passwordless sudo.
What to do
Look for the extension at the affected versions and engage incident response where it is found. Uninstalling the extension does not remove the backdoor.
- Kill the
/bin/shretry loop and anysshorautosshprocesses connecting to 134.209.82[.]225. - Unload and delete
com.apple.sysmond.plist. Clean the Linux cron entry or the Windows task and Startup script. Remove~/.config/.smtand~/.config/.smtk. - Remove the
svc-telemetrykey fromauthorized_keys, delete/tmp/.stk_*, and check that Remote Login was not enabled unexpectedly. - If SSH was enabled or an inbound login occurred, rotate credentials reachable by that user, especially those matching the environment variable filter above.
Detection on macOS with Endpoint Security telemetry:
- Alert on file writes to
~/.ssh/authorized_keysby IDE helper processes (Code Helper, Cursor Helper). Process rules forechoorteemiss this, because the write uses Node'sfs.appendFileSync. - Alert on non-Apple processes writing
com.apple.*LaunchAgent plists, and on LaunchAgents running/bin/shagainst hidden scripts in the home directory. - Alert on
sshorautosshwith-R *:0:localhost:22and identity files in/tmp/.stk_*or~/.config/.smtk. - Alert on outbound connections to 134.209.82[.]225 on ports 22 and 8099, and on attempts to 127.0.0.1:8099.
- Do not require
systemsetup -setremotelogin onas an alert condition.
To find operator logins, check SSH logs for sessions from 127.0.0.1 or ::1 that authenticate with the svc-telemetry key. Hunt by public-key fingerprint, not only the comment string.
Caveats
Phorion focuses on macOS, so the Linux and Windows paths are described less fully. It does not explain why the beacon also goes to 127.0.0.1:8099, since the script opens no listener there. The page does not say how the extension bundle was compromised.
Organisations named here
- Cursor
- Phorion
Technologies named here
- Phorion
- Endpoint Security framework
- macOS
- Linux
- Windows
- Claude Code
- Cursor
- VS Code
- SSH
- Node.js
- autossh
- Claude Code for VS Code extension 2.1.312 (Cursor Marketplace, macOS and Windows)
- Claude Code for VS Code extension 2.1.313 (Cursor Marketplace, macOS and Windows)
- Cursor editor
- Cursor Marketplace
- systemsetup
Techniques named here
- Supply chain compromise
- SSH Authorized Keys
- Launch Agent
- Masquerading
- Compromise Software Supply Chain
- com.apple.sysmond
- File modification telemetry detection
- Host reconnaissance beacon
- Reverse SSH tunnel
- svc-telemetry
Concepts named here
- Extension privileges
- macOS Remote Login check bug
- Tunnelled logins appear as localhost
- Windows code path bug
Related in Supply Chain


