The Claude Code logo. Image: Anthropic

A tampered copy of Anthropic’s Claude Code extension sat in Cursor’s extension marketplace for about 11 hours on Thursday, and anyone who installed or updated to it may have opened a door into their computer. Cursor said in a security notice that the malicious versions, Anthropic.claude-code 2.1.312 and 2.1.313, were available from about 2:27am to 1:35pm Pacific time on October 29 (09:27 to 20:35 UTC) and reached at most 5,000 users, whom it will contact directly.

Anthropic didn’t build the malicious version, Cursor said, and only the copy in Cursor’s own marketplace was affected. A technical analysis by OpenSourceMalware, which Dean Hardcastle alerted as the attack unfolded, says the @anthropic-ai/claude-code npm package, the Open VSX extension and the Microsoft VS Code Marketplace extension are all clean.

What the fake extension did

The malicious build looked and worked like the real thing. Its bundled Claude Code program was the official one; the only change, OpenSourceMalware found, was a 66-line loader added to the top of the extension’s main extension.js file. It ran as soon as the editor loaded the extension, so users didn’t need to start a Claude conversation, and it hid its errors so Claude Code carried on as normal.

Once running, it:

  • Collected details about the machine: hostname, username, operating system, home and working folders, the Git email address, public IP address, and the names (not the values) of up to 40 environment variables containing words such as KEY, TOKEN, SECRET or AWS.
  • Added an attacker’s SSH key to ~/.ssh/authorized_keys, labelled svc-telemetry to pass for an admin account.
  • Tried to switch on the computer’s SSH server (Remote Login on a Mac, OpenSSH Server on Windows) and open a reverse SSH tunnel to a server at 134.209.82.225, retrying every 60 seconds.
  • Set itself up to survive a restart with a fake com.apple.sysmond LaunchAgent on macOS, a scheduled task called SysMon or a Startup-folder script on Windows and, according to OpenSourceMalware, a crontab entry on Linux.
  • Reported back to the attacker’s server over plain HTTP on port 8099.

It downloaded no further malware, OpenSourceMalware found. The danger was the tunnel, which would let whoever controlled the server log in and hunt for credentials.

Cursor says most logins would have failed

Cursor’s notice is more reassuring on that point. Switching on the SSH server needs administrator rights, which the extension doesn’t have on most Macs and Windows PCs, so on those machines “the attacker could not have logged in through the tunnel”, it said. The key, the persistence scripts and the report to the attacker would still have gone through. Cursor also had the attacker’s server taken offline by its cloud provider, so the tunnel and the beacon no longer work.

Cursor said it pulled the version on detection, shut its whole marketplace as a precaution, found no other extensions tampered with, then rotated its keys and rebuilt the marketplace. It hasn’t said how the malicious build got into its marketplace. It told users on X:

Cursor, which SpaceX bought in August, is asking everyone to update to Claude Code for VS Code 2.1.314. Anthropic has since said its own systems weren’t breached (see the update below).

How to check if you were hit

Only people who installed or updated the extension from Cursor’s marketplace in that window are at risk. The giveaway is the attacker’s key in your SSH authorised keys file. On a Mac or Linux machine, Cursor’s check is this one line in Terminal:

grep -qs svc-telemetry ~/.ssh/authorized_keys && echo "svc-telemetry key found" || echo "No key found; machine not impacted"

On Windows, the notice has a PowerShell version that also looks in C:\ProgramData\ssh\administrators_authorized_keys. If the key turns up, the machine was affected.

How to clean up

Removing or updating the extension isn’t enough, Cursor warned, because the malware leaves standalone scripts behind that keep running. Its advice for affected machines:

  • Isolate the machine, then run Cursor’s remediation script for macOS (as your normal user, not root) or Windows (in PowerShell opened as administrator). It removes the extension, the key, the persistence and any tunnel.
  • To look by hand, check for ~/.config/.smt, ~/.config/.smtk and ~/Library/LaunchAgents/com.apple.sysmond.plist on a Mac, or the SysMon scheduled task and a sysmon.cmd file in the Startup folder on Windows. OpenSourceMalware adds an @reboot line in crontab -l on Linux.
  • From a different, trusted computer, change the passwords, API keys, tokens and sessions the machine could reach, and consider rebuilding it.
  • Update to Claude Code for VS Code 2.1.314.

Update: Cursor says version 2.1.312 was tampered with too

Cursor revised its security notice at 11:30am Pacific time on October 30 (18:30 UTC) to say an earlier build, Anthropic.claude-code 2.1.312, carried the same malicious code as 2.1.313. Both versions were for Windows and macOS, and anyone who installed or updated to either from Cursor’s marketplace in the same window should run the checks above. The notice now lists file fingerprints for both.

It also says that, “due to errors in the malicious code”, the attempt to switch on SSH and open the tunnel would fail unless Cursor had been started with administrator privileges, which it calls “highly unusual circumstances”. The notice still says the key, the persistence scripts and the report to the attacker’s server went through, so Cursor’s clean-up advice stands. It still hasn’t said how the tampered builds got into its marketplace.

Update: Anthropic says its own systems weren’t breached

Anthropic says the attack didn’t touch its systems and that the tampered extension was published through Cursor’s marketplace by someone with access to it. Felix Rieseberg, a member of Anthropic’s technical staff, said on X on October 30:

David Dworken, who works on security at Anthropic, added that Anthropic was “not involved with building, publishing, or hosting” the tampered build, and that the copies in Microsoft’s VS Code Marketplace and Open VSX are not affected. Cursor still hasn’t explained how the attacker got that access, and it didn’t answer Wired’s questions on whether its own systems were breached.

Update: Microsoft says no attacker is named yet, and Defender now flags the malware

Microsoft published its own analysis of the tampered extension on October 30. It says it has confirmed that the malicious versions were never published or distributed through its Visual Studio Marketplace or the @anthropic-ai/claude-code npm package, that Anthropic told Microsoft its systems weren’t compromised, and that “all evidence suggests that the incident is limited to Cursor marketplace”. It doesn’t say how the build got there, gives no count of affected machines and names no attacker: its technical breakdown, it says, does “not establish attribution to a particular threat actor”.

The analysis confirms the Linux persistence OpenSourceMalware described, a crontab entry that runs at start-up, and adds detail on Windows, where the malware tried to make its SysMon task run with full system rights before falling back to the Startup folder. On Mac and Linux it preferred the autossh tool to keep the tunnel alive. Microsoft Defender now flags the malware under names including Trojan:MacOS/SmtShellMal.A and HackTool:MacOS/RevAnthShell.A, and Microsoft lists the attacker key’s fingerprint (SHA256:0Z6R+DF64Do2nwQic8a7kkfDLNNk4IiK+2U2Rci4htk) so administrators can confirm a match before deleting it.

Its clean-up advice goes a little further than Cursor’s: keep copies of the extension, the changed SSH files and the startup scripts as evidence before removing them, delete only the attacker’s key and leave legitimate ones in place, and check what each startup item actually runs rather than going by its name. It also warns that a running SSH process “does not necessarily mean the attacker gained access”.

Why it matters

Coding assistants run with their developer’s access, which makes their extensions a prize: this comes less than a fortnight after LiteLLM’s PyPI package was poisoned to steal AI API keys. A trusted name in a marketplace is no guarantee, so it pays to know what a Claude Code add-on can reach before installing one.

Sources: Cursor security notice, OpenSourceMalware, Cursor on X, Felix Rieseberg on X, David Dworken on X, Wired, Microsoft Security.

Latest SpaceXAI news

More SpaceXAI news