Insights

    AI Security

    A coding extension update can leave a backdoor after removal

    Devence Lab

    · 2 min read

    Share
    A coding extension update can leave a backdoor after removal
    Photograph · Markus Spiske / Pexels

    A tampered Claude Code-branded extension served by Cursor attempted to plant SSH access and startup persistence. Responders must check the host, because removing the extension does not remove its changes.

    On 29 October, Cursor reported that tampered Claude Code-branded extension versions 2.1.312 and 2.1.313 were served through its extension marketplace for several hours. Microsoft's analysis found injected JavaScript that ran as the extension loaded and attempted to plant SSH access, reverse forwarding and startup persistence. The incident turns an ordinary editor update into an endpoint investigation.

    Microsoft says the malicious packages were not distributed through the Visual Studio Marketplace or the Claude Code npm package, and Anthropic told Microsoft its systems were not compromised. The affected distribution path matters: teams should identify installations from Cursor's marketplace rather than treating every copy of the extension as suspect.

    The extension folder is only the entry point

    The loader attempted to add an attacker controlled public key to the user's SSH authorised keys, enable the local SSH service and start an outbound reverse tunnel. It also wrote platform specific scripts and startup configuration so the connection could return. Microsoft warns that successful remote access depended on privileges, SSH settings and the remote server; code capability alone does not prove an intruder reached every affected host.

    The distinction does not make a simple uninstall sufficient. A failed tunnel could still leave an SSH key, script or startup entry behind. Updating the extension changes the package in the editor, but it does not clean files written elsewhere on the workstation.

    Removing the entry point does not remove the access it may have planted.

    Scope exposure before cleanup

    Start with extension installation records for the two versions and the reported marketplace exposure window. On matching machines, preserve the package, SSH authorisation files, startup configuration and endpoint telemetry before making changes. Correlate suspicious SSH processes and outbound connections with actual logons and command activity. A matching filename or process is an investigative lead, not proof of compromise.

    Microsoft notes that the loader gathered host details and selected environment variable names, not their values, for a delayed report. That observation should prevent an unsupported claim that every named secret was stolen. Credential rotation becomes a stronger requirement when telemetry shows access, or when device trust cannot be restored after investigation.

    Make the recovery check durable

    Remove confirmed malicious keys, scripts and startup objects only after evidence collection, then check that they do not return after login or restart. Review the configured action of each startup item so legitimate remote development tools remain intact. Rebuild a host when investigation cannot establish a trustworthy state.

    For future releases, restrict extension installation to approved publishers and use an installation delay for newly published versions where the editor permits it. The release gate is operational: a marketplace identity and a clean-looking editor are not evidence that an extension update stayed inside its installation directory. Endpoint controls must observe what the extension process can change.

    Sources

    1. Inside a malicious Claude Code-branded extension and its persistent SSH backdoor · Microsoft Security Research

    Written by the Devence Lab research team.

    Share