Cloud Computing

Cursor removes malicious Claude Code extension after SSH backdoor attempt

The security incident involving a malicious version of the Claude Code extension, distributed via the Cursor VS Code Extension Marketplace, has sent shockwaves through the developer community, highlighting the increasing vulnerability of AI-driven software supply chains. On October 29, users of the popular Cursor IDE inadvertently downloaded compromised versions of an extension branded as "Claude Code," which was designed to grant unauthorized remote access to their development environments.

The malicious activity, which persisted for approximately 11 hours, allowed attackers to execute scripts that attempted to install persistent Secure Shell (SSH) backdoors. These backdoors were designed to provide threat actors with long-term, remote command-and-control capabilities over the workstations of unsuspecting software engineers.

Chronology of the Compromise

The incident began in the early hours of October 29. According to official records and security notices provided by Cursor, the malicious versions—specifically identified as 2.1.312 and 2.1.313—were made available on the marketplace at approximately 2:27 am PT. The campaign remained active until 1:35 pm PT, during which time it was potentially installed by developers seeking to integrate Anthropic’s AI capabilities into their workflow.

Upon discovery of the anomaly, Cursor acted to remove the compromised versions from its marketplace. The platform then initiated a comprehensive incident response protocol, which included the temporary suspension of marketplace operations, a full audit of access logs, the rotation of critical internal keys, and a complete rebuild of the marketplace infrastructure to ensure the integrity of future extensions.

Technical Analysis: How the Malware Operated

Security researchers at Phorion conducted an in-depth analysis of the payload. Their findings reveal a sophisticated execution strategy: the malicious code was injected directly into the beginning of the extension’s primary JavaScript file. This placement ensured that the malicious payload executed immediately upon the extension loading, bypassing standard activation checks.

The primary objective of the malware was to establish persistence. It attempted to append an attacker-controlled SSH public key to the user’s ~/.ssh/authorized_keys file. If successful, this would have allowed the attackers to bypass authentication and gain terminal access to the developer’s machine at any time. Furthermore, the malware attempted to configure reverse tunnels to a remote server, ensuring the connection remained active even if the user changed their network configuration.

Microsoft Threat Intelligence also contributed to the investigation, noting that the malware was designed for data exfiltration. Beyond establishing backdoors, the script systematically scraped host information, including machine identifiers, usernames, operating system versions, and working directories. Of particular concern was the script’s targeted search for sensitive environment variables. The malware scanned for keys, tokens, and secrets associated with AWS, GCP, and other cloud providers, collecting the names of these variables—though not necessarily their values—for exfiltration to the attacker’s command-and-control server.

Limitations and Flaws in the Malicious Code

Despite the malicious intent, technical errors within the script hindered its effectiveness. Phorion’s analysis identified a significant flaw in the macOS implementation: the malware utilized a system command to verify the status of Remote Login that required elevated (administrator) privileges. When executed by a standard user, the command returned an access error, causing the script to abort the SSH configuration process. A similar functional failure was observed in the Windows version, where errors in the SSH service setup command prevented the intended persistent connection from fully establishing in many instances.

However, security experts emphasize that these technical failures do not mitigate the severity of the threat. The ability of the malware to plant unauthorized SSH keys remained a critical risk, regardless of whether the secondary persistence mechanisms functioned as intended.

Anthropic’s Stance and Marketplace Security

Anthropic, the company behind the official Claude AI, moved quickly to distance its official infrastructure from the incident. Felix Rieseberg, a member of Anthropic’s technical staff, clarified through social media that the breach was confined to the Cursor ecosystem and did not involve an intrusion into Anthropic’s internal systems, servers, or employee devices.

"The versions on our official channels are not affected, and this only impacts Cursor users," Rieseberg confirmed, stating that Anthropic is actively collaborating with Cursor to assist in the remediation process. The incident highlights a growing concern in the tech industry: the "trust-by-default" model of extension marketplaces. As AI tools become more integrated into development environments, these marketplaces are increasingly becoming prime targets for supply chain attacks.

Implications for the Software Supply Chain

The incident serves as a stark reminder of the risks inherent in the modern software supply chain. Yash Kadakia, founder and CTO of Security Brigade, noted that an extension marketplace acts as an extension of an organization’s internal infrastructure. When a trusted channel is compromised, the standard security perimeter is effectively bypassed.

"When malicious code can reach developers through what appears to be a legitimate, routine update, the traditional assumption that software from a trusted marketplace is safe starts to break down," Kadakia observed.

Industry analysts suggest that the incident will likely force a shift in how development organizations manage third-party tools. Recommended defensive postures now include:

  • Implementation of Allowlisting: Organizations should restrict the installation of IDE extensions to a vetted, allowlisted set of tools rather than allowing open access to public marketplaces.
  • Controlled Updates: Rather than allowing automatic updates for extensions, enterprises should consider delaying updates until they have been tested in a sandboxed environment.
  • Endpoint Monitoring: Security teams should deploy advanced endpoint detection and response (EDR) solutions that monitor for suspicious outbound connections and unauthorized modifications to SSH configuration files.
  • Credential Hygiene: Developers are advised to treat any machine that has interacted with the compromised extension as potentially tainted. This includes rotating all secrets, tokens, and SSH keys that may have been present on the device during the time the malicious extension was active.

Beyond Removal: The Need for Remediation

Steve Povolny, vice president of AI strategy and security research at Exabeam, emphasized that uninstalling the extension is insufficient for full remediation. Because the malware intentionally placed scripts and startup entries outside of the extension’s local directory, a simple uninstallation leaves the backdoor intact.

"Removing the extension only sends the visitor away while the spare key stays on the hook," Povolny warned. He recommended that any developer who may have installed the compromised versions must audit their authorized_keys files for any unfamiliar entries and immediately revoke any potentially exposed credentials.

The incident also highlights the danger of relying on automated tools for security. The use of "svc-telemetry" as a comment in the malicious SSH key was an attempt to blend into standard system operations—a common tactic in modern supply chain attacks. Security researchers advise that organizations should look for the actual fingerprint of the SSH key, rather than relying on labels or comments that can be easily spoofed by malicious actors.

Looking Ahead

As the investigation into the Cursor marketplace compromise continues, the incident is expected to spur a broader conversation regarding the regulation of AI-powered development tools. With developers increasingly relying on AI assistants to accelerate coding, the surface area for supply chain attacks is expanding rapidly.

For now, both Cursor and Anthropic are focusing on stabilizing their platforms and ensuring that no secondary infections remain in the user base. For the wider development community, the event serves as a critical warning: the convenience of integrated AI tools comes with the responsibility of rigorous security vetting. In an era where a single compromised extension can grant an attacker a foothold into enterprise production environments, the traditional boundaries of software security must be continuously redefined and fortified.

Related Articles

Back to top button