Malicious Claude Code Extension Targeted Cursor Users With SSH Backdoor
The Cursor marketplace incident shows how a compromised developer extension can reach sensitive systems before a developer clicks anything. A tampered build of Anthropic’s Claude Code extension tried to install an SSH backdoor, preserve access across restarts and send information about affected machines to an attacker.
Cursor said versions 2.1.312 and 2.1.313 were available for Windows and macOS for about 11 hours on October 29, from roughly 2:27 a.m. to 1:35 p.m. PT. The company removed both versions after discovering the compromise.
Cursor’s security notice said the code attempted to add an attacker-controlled SSH key, enable local SSH access and open a reverse tunnel to a remote server. Cursor stressed that Anthropic hadn’t developed the affected versions.
Anthropic technical staff member Felix Rieseberg said on X that the incident didn’t involve a breach of Anthropic’s systems or employee laptops. A malicious actor used access to Cursor’s marketplace to publish the altered extension, he said. Anthropic’s official distribution channels weren’t affected, and the incident was limited to Cursor users. Anthropic said it was working with Cursor. Neither company had responded to requests for comment by publication time.
The payload ran when the extension loaded
Security firm Phorion found the malicious code at the start of the extension’s JavaScript file, ahead of its regular activation logic. That placement meant the payload could run as soon as the extension loaded. “The user doesn’t need to interact with the extension for the payload to fire,” Phorion said.
The code tried to place an SSH key in the user’s authorized_keys file, connect to a remote server and create scripts and startup entries to keep the connection alive after a restart. Phorion found implementation errors that limited some of those efforts: on macOS, a check for whether Remote Login was disabled required administrator privileges, so it returned an access error and the malware skipped enabling SSH. On Windows, a problem in the service setup command could stop that part of the attack from working correctly.
Those flaws didn’t prevent every action. Cursor said enabling local SSH access would generally fail without administrator privileges, but the extension could still add the attacker’s key, install persistence mechanisms and transmit host details.
Microsoft Threat Intelligence found that the malware collected 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 names, not their values, in its analysis.
Uninstalling may leave access behind
Cursor warned that removing the extension might not clean up the machine because the malware placed scripts outside the extension’s installation directory. The SSH key could also remain after the package was gone.
Steve Povolny, Exabeam’s vice president of AI strategy and security research, said that lingering key makes cleanup a priority: “Removing the extension only sends the visitor away while the spare key stays on the hook.” He recommended inspecting authorized SSH keys on systems accessible to affected developers, rotating credentials that may have been exposed and reviewing logs for logins made with unfamiliar keys.
Phorion advised checking the key’s fingerprint instead of relying only on its comment, svc-telemetry. Povolny also pointed to the access developers often hold across source repositories, cloud accounts and production systems: a compromised workstation can provide a path to wider enterprise resources.
Marketplace access is part of the supply chain
Yash Kadakia, founder and CTO of Security Brigade, said organizations should treat extension marketplaces as software supply chains. A routine update from a familiar marketplace can still deliver malicious code if an attacker gains publishing access, he said.
Kadakia recommended verifying publishers and package integrity, limiting which extensions and versions developers can install, and using allowlists and controlled updates. Endpoint monitoring and outbound connection restrictions can help detect or limit suspicious activity. Short-lived credentials, separated development environments and tightly scoped access to sensitive infrastructure can also reduce the reach of a compromised machine.
Cursor said it removed the affected builds, temporarily shut down the marketplace, audited access, rotated keys and rebuilt the marketplace before restoring it. For development teams, the incident’s practical lesson is to treat extension updates as executable code: verify what’s installed, check for persistence outside the package and review the credentials and systems the developer’s machine could reach.