Cursor removes malicious Claude Code extension after SSH backdoor attempt

The cybersecurity community was rocked on October 29 when it was discovered that a malicious iteration of the Anthropic Claude Code extension had infiltrated the Cursor VS Code Extension Marketplace. This supply chain attack, which persisted for approximately 11 hours, targeted software developers by attempting to install persistent Secure Shell (SSH) backdoors on their workstations. The incident has raised significant alarms regarding the security of integrated development environment (IDE) ecosystems and the trust users place in third-party extension marketplaces.
The Anatomy of the Compromise
The malicious activity, which occurred between 2:27 a.m. PT and 1:35 p.m. PT, involved versions 2.1.312 and 2.1.313 of the Claude Code extension. According to security researchers at Phorion, the malicious payload was injected directly into the beginning of the extension’s primary JavaScript file. By placing the malicious code at the entry point of the script, the attackers ensured that the payload would execute automatically the moment the extension loaded—bypassing any requirement for user interaction or manual activation.
Once active, the malware performed a series of reconnaissance and persistence tasks. It sought to inject an attacker-controlled SSH key into the victim’s authorized_keys file, which would have granted the perpetrator unfettered remote access to the developer’s machine. Additionally, the malware attempted to establish a reverse tunnel to a command-and-control (C2) server, ensuring that the attacker could maintain a connection even if the initial session was terminated. To ensure long-term viability, the script also created startup entries designed to survive system reboots.
Technical Failures and Microsoft’s Analysis
While the intent of the malware was severe, technical flaws in the implementation appear to have hindered its full effectiveness. Phorion noted that on macOS, the malware attempted to use a system command to check if Remote Login was disabled. Because the command required administrative privileges, the script failed when running in a standard user environment, causing the SSH-enabling portion of the payload to abort. Similarly, researchers observed errors in the Windows-specific code that occasionally prevented the SSH service setup from executing correctly.
Microsoft Threat Intelligence conducted an extensive analysis of the data-harvesting capabilities of the extension. Their findings revealed that the malware was designed to scrape a wide array of system metadata, including machine names, active usernames, operating system versions, and current working directories. Perhaps most concerning was the malware’s focus on environment variables. The code specifically scanned for variables containing strings such as "TOKEN," "SECRET," "AWS," "GCP," and "PASS." While the researchers noted that the malware appeared to collect the names of the variables rather than the sensitive keys themselves, the reconnaissance effort indicates a clear intent to identify high-value targets for future exploitation.
Official Responses and Clarifications
In the wake of the discovery, both Cursor and Anthropic moved quickly to distance themselves from the incident and mitigate potential damage. Anthropic, the developer of the legitimate Claude Code extension, clarified through technical staff member Felix Rieseberg that the issue was not the result of a breach within Anthropic’s own infrastructure. Rieseberg emphasized that the legitimate versions of the extension on official channels remained secure and unaffected.
"The versions on our official channels are not affected, and this only impacts Cursor users," Rieseberg wrote in a statement on X. Anthropic confirmed they were working in close coordination with Cursor to investigate the breach.
Cursor, for its part, released a security notice acknowledging the presence of the malicious versions and outlining their remedial actions. The company confirmed that upon discovering the compromise, they removed the affected versions, temporarily suspended the marketplace, performed a full audit of access logs, rotated all internal security keys, and rebuilt the marketplace infrastructure from the ground up before restoring service.
The Lingering Threat: Why Deletion Isn’t Enough
One of the most critical warnings issued by security experts concerns the persistence mechanisms employed by the malware. Because the malicious scripts were designed to operate outside the standard directory where VS Code extensions are installed, simply uninstalling the Claude Code extension does not guarantee the removal of the backdoor.
Steve Povolny, Vice President of AI Strategy and Security Research at Exabeam, highlighted the gravity of this situation. "Removing the extension only sends the visitor away while the spare key stays on the hook," Povolny explained. He warned that if an attacker successfully added an SSH key to a developer’s authorized_keys file, that key remains valid regardless of whether the original malicious extension is present on the system.
Consequently, security professionals are advising all affected developers to perform a deep-clean audit of their systems. This includes:
- Inspecting SSH Keys: Manually reviewing
~/.ssh/authorized_keysfor any unrecognized or suspicious entries. - Credential Rotation: Assuming that any API keys, tokens, or environment variables mentioned in the Microsoft analysis may have been identified, and rotating them immediately.
- Log Review: Checking system and network logs for unauthorized SSH login attempts originating from unknown IP addresses.
The Broader Implications for Supply Chain Security
The Cursor incident serves as a stark reminder that extension marketplaces represent a critical, yet often overlooked, link in the modern software supply chain. Yash Kadakia, founder and CTO of Security Brigade, noted that developers frequently treat IDE extensions as "trusted" software, often installing them without the rigorous vetting processes applied to enterprise-grade applications.
"An extension marketplace is effectively another software supply chain," Kadakia observed. "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."
The implications for enterprise security are significant. Developers often hold "keys to the kingdom," possessing access to production environments, source code repositories, and cloud infrastructure. A single compromised workstation can serve as a bridgehead for lateral movement, allowing attackers to escalate privileges and exfiltrate sensitive intellectual property or customer data.
Future Mitigation Strategies
In light of this event, industry analysts are calling for a shift in how development tools are managed within organizations. Recommended best practices include:
- Publisher Verification: Implementing stricter requirements for developers and companies to prove their identity before publishing to an extension marketplace.
- Package Integrity: Moving toward cryptographic signing of extensions to ensure that what the user downloads is exactly what the developer intended to release.
- Allowlisting: Enterprises should consider restricting the types of extensions developers can install, maintaining an "allowlist" of vetted, trusted tools.
- Endpoint Monitoring: Utilizing advanced Endpoint Detection and Response (EDR) solutions to monitor for unusual outbound network connections or unexpected modifications to configuration files like
authorized_keys. - Environment Segregation: Utilizing virtualized or containerized development environments that limit the damage an individual extension can do to the host machine.
The Cursor-Claude Code incident is a sobering reminder of the "trust tax" paid in the digital age. As AI-powered tools become increasingly central to the software development lifecycle, they simultaneously become high-value targets for threat actors. While the immediate threat has been neutralized, the incident serves as a foundational case study for the necessity of robust supply chain security protocols in the era of rapid software deployment. As organizations continue to integrate more AI-driven extensions into their workflows, the balance between convenience and security will remain a primary challenge for developers and IT security teams alike.







