Malicious Claude Code Extension in Cursor Marketplace Tried to Plant an SSH Backdoor

| 2 Min Read
A tampered extension available for about 11 hours tried to install persistent SSH access and collect system details, exposing gaps in marketplace defenses.

A compromised developer extension can turn a routine update into a foothold on machines with access to source code and cloud services. That’s what happened when a tampered version of Anthropic’s Claude Code extension appeared in Cursor’s VS Code Extension Marketplace on October 29.

Cursor said versions 2.1.312 and 2.1.313 were available for roughly 11 hours, from about 2:27 a.m. to 1:35 p.m. PT. The company removed them after discovering code that tried to add an attacker-controlled SSH key, enable local SSH access, and create a reverse tunnel to an attacker’s server. The versions targeted Windows and macOS.

Anthropic’s technical staff member Felix Rieseberg said the incident did not involve a breach of Anthropic’s systems or employee laptops. The modified extension was published through access to Cursor’s marketplace; Anthropic’s official distribution channels weren’t affected. Rieseberg said Anthropic was working with Cursor on the incident.

Payload ran when the extension loaded

Security firm Phorion found malicious JavaScript inserted at the start of the extension’s code. It ran as soon as the extension loaded, ahead of the normal activation process, so users didn’t need to open or interact with Claude Code for the payload to execute.

The code tried to add a public key to the user’s authorized_keys file and establish a connection to a remote server. It also created scripts and startup entries intended to preserve access through a restart. Phorion found implementation errors that could limit parts of the attack: on macOS, a check for Remote Login required administrator privileges and returned an access error when run without them; on Windows, a problem in the SSH service setup command could stop it from running correctly.

Microsoft Threat Intelligence reported that the malware gathered machine names, usernames, operating systems, working directories, and Git email addresses. It also searched environment-variable names for terms such as KEY, TOKEN, SECRET, PASS, AWS, and GCP, retaining up to 40 matches. Microsoft said the malware collected the matching variable names, not their values.

Uninstalling may leave access behind

Cursor said enabling local SSH would generally fail without administrator privileges, but other actions could still succeed: planting the SSH key, creating persistence files, and sending host information. Because scripts were placed outside the extension’s install directory, removing the extension alone might not clean up the machine.

Exabeam’s Steve Povolny said the key could remain after the extension was removed. He advised checking authorized SSH keys on machines accessible to affected developers, changing credentials that may have been exposed, and examining logs for sign-ins using unfamiliar keys. Phorion recommended identifying the planted key by its fingerprint rather than relying only on the comment svc-telemetry.

The concern extends beyond a single workstation. Developers can hold access to code repositories, cloud accounts, and production systems, so a compromised device may provide a path into other company resources.

Marketplace trust depends on stronger controls

Security Brigade founder and CTO Yash Kadakia said extension marketplaces should be treated as part of the software supply chain. A malicious update delivered through a familiar marketplace challenges the assumption that routine installations from trusted sources are safe, he said.

Kadakia called for stronger publisher checks, package integrity verification, and controls over which extensions and versions developers can install. He also recommended extension allowlists, managed updates, endpoint monitoring, and limits on outbound connections. Short-lived credentials, separated development environments, and restricted access to sensitive systems can help limit the damage if a developer machine is compromised.

Cursor said it removed the affected versions, temporarily shut down its marketplace, audited access, rotated keys, and rebuilt the marketplace before restoring service. The incident puts a practical question in front of development teams: whether their extension policies and cleanup procedures can contain a trusted tool that turns hostile.

Source: David Miller · www.csoonline.com

Comments

Please sign in to comment.