cybersecurity

Backdoor Found in 'Claude Code' Extension on Cursor Marketplace

A malicious version of the 'Claude Code' extension on the Cursor IDE marketplace installed a persistent SSH backdoor on developer machines.

A malicious version of the 'Claude Code for VS Code' extension distributed on the Cursor IDE marketplace was found to install a persistent SSH backdoor. The incident is a reminder that third-party extension marketplaces carry significant supply chain risk, and vetting your developer tools is not optional. My verdict is simple: avoid niche marketplaces for critical tools unless you've audited the code yourself.

What happened? Security firm Phorion discovered a critical backdoor in version 2.1.313 of what was presented as an official 'Claude Code' extension. According to the original report on the compromise, the malicious package was distributed exclusively through the Cursor IDE's marketplace, not the official Microsoft VS Code Marketplace. Cursor has since removed the compromised version, but any developer who installed it is potentially exposed.

How did the backdoor work? The compromise wasn't subtle. The malicious extension code directly targeted the user's SSH configuration on macOS, Linux, and Windows systems. It appended an attacker-controlled public key to the `~/.ssh/authorized_keys` file. This action alone grants the attacker persistent shell access. To make matters worse, it also established a reverse SSH tunnel to a command-and-control server, ensuring access even if the victim's machine is behind a firewall or NAT.

What's the fix? If you installed this extension from the Cursor marketplace, you need to check your machine immediately. Inspect your `~/.ssh/authorized_keys` file for any public keys you did not add yourself and remove them. After cleaning your SSH configuration, uninstall the compromised extension. Simply removing the extension is not enough, as the malicious key will persist in `authorized_keys`.

Should you use third-party marketplaces? This incident highlights the security trade-offs of using forks and alternative marketplaces like Cursor. While they might offer novel features, their vetting processes are often less mature than those for major platforms like the official VS Code Marketplace. A supply chain attack that slips through a smaller ecosystem can go undetected for longer. For core development tools, sticking to the official, more heavily monitored distribution channels is the safer bet. The convenience of a fork is not worth a root shell on your machine.

FAQ

Which version was affected? Version 2.1.313 of the 'Claude Code for VS Code' extension, specifically the one distributed on the Cursor IDE marketplace, was compromised.

How do I check if I was compromised? Examine the contents of your `~/.ssh/authorized_keys` file. If you find any SSH public keys that you do not recognize, you should remove them immediately.

Was the official VS Code extension from Anthropic affected? No. The compromise was specific to a version published on the third-party Cursor marketplace. The extension on the official Microsoft VS Code Marketplace was not implicated in this attack.