AI Coding Assistant Marketplace Poisoning: Analyzing the SSH Backdoor Supply Chain Attack and How to Defend Against It

    A malicious version of a popular AI coding assistant extension was briefly published to an IDE's extension marketplace using the official extension ID, installing a persistent SSH backdoor on developers' machines. This article breaks down how the attack worked, why the distribution channel was the weak link, and provides practical checklists for individual developers and platform teams to detect and prevent similar supply chain compromise.

    1. Incident Overview: Compromised Without Doing Anything Wrong

    A typical supply chain poisoning incident recently occurred in the extension marketplace of an AI-powered coding tool. Unlike attacks that rely on typosquatting or impersonated names to trick users into manual installation, the attacker uploaded a tampered version of a well-known AI coding extension using its official extension ID. This means:

    • Users did nothing wrong and had no way to notice anything suspicious;
    • The IDE’s auto-update mechanism pulled the malicious code onto local machines automatically;
    • The malicious version remained on the marketplace for roughly 11 hours before being taken down, with an estimated maximum of 5,000 users installing it during that window.

    What makes this attack particularly dangerous is that it breaks a long-standing trust assumption among developers: “downloads from official channels are safe.” The extension ID, publisher identity, and version numbering all looked completely normal — the only anomaly was hidden at the byte level.

    2. Key Facts

    Item Details
    Affected target An AI coding assistant extension, published using the official extension ID
    Affected versions A version number that never existed on official channels, plus a tampered marketplace-side copy of another version released around the same time
    Affected platforms macOS (ARM) and Windows (x64)
    Distribution channel Only the IDE’s own extension marketplace; the official public marketplace was not affected
    Exposure window About 11 hours
    How the attacker obtained publishing rights Not publicly disclosed; the official announcement did not explain

    A few points deserve closer attention:

    1. The ghost version number. The tampered version number had never appeared in any official public marketplace or package repository. After confirming this, the official team skipped that version number entirely when releasing the fix to avoid confusion. This is an important signal in version supply chain auditing — a gap in the version number sequence should trigger a provenance investigation.

    2. Same version number, different bytes. Even more subtle: another version existed on both the public marketplace and the IDE marketplace as “same name, different artifact.” The package hash on the public marketplace was clean, while the identically-named version on the IDE marketplace was a different file — and it had been tampered with. This indicates the attack occurred at the distribution stage, not the build stage. Version number comparison alone cannot detect this; hash verification is essential.

    3. The lesson from early false reports. Early in the incident, some reports claimed multiple official channels had been compromised. Security teams later corrected this after hash comparisons showed only a single channel was affected. The takeaway: incident boundaries must be confirmed through verifiable means such as hash comparison, not second-hand reports.

    3. What the Malicious Code Did

    Based on sample analysis from multiple security teams, once loaded, the extension performed the following actions (summarized from community-disclosed behavioral indicators):

    1. Persistent SSH backdoor: It generated or modified the SSH authorized keys file in the user’s home directory, writing in a public key controlled by the attacker — allowing direct SSH login to the victim’s machine;
    2. Platform-specific activation: It checked the operating system and CPU architecture at runtime, activating only on specific platform combinations to reduce the chance of being caught by sandbox analysis;
    3. Silent execution: No pop-ups, no obvious process anomalies — users working normally in the IDE were effectively unaware.

    A indicative detection approach (for self-checking only, not attack reproduction):

    1. # Check whether authorized_keys contains unfamiliar public keys
    2. cat ~/.ssh/authorized_keys
    3. # Verify the origin and comment field of each key
    4. # Check whether the sshd configuration has been modified
    5. # (e.g., whether the authorized keys path has been redirected)
    6. grep -E "AuthorizedKeysFile|PermitRootLogin" /etc/ssh/sshd_config

    On Windows, check scheduled tasks, startup items, and any traces of unusual key-generation tool invocations.

    4. Why the Distribution Channel Was the Weak Point

    The core issue in this incident is not how sophisticated the malicious code was, but where the trust chain broke:

    • Build and publishing credentials were abused: The official team confirmed the malicious package was not built or published by them, yet the attacker gained access to the marketplace’s publishing pipeline. This points to leaked publishing credentials, missing marketplace-side publishing review, or flaws in publisher identity verification;
    • The self-hosted marketplace lacked independent verification: If an IDE’s own extension marketplace only performs “mirror sync + re-hosting” without hash comparison and signature verification against upstream packages, it is inherently exposed to the risk of package substitution in transit;
    • Auto-update amplified the blast radius: Auto-updating is normally a security best practice, but when the upstream source is poisoned, it becomes a scalable distribution pipeline for malicious code.

    From a supply chain modeling perspective, this was a classic case of distribution-layer poisoning (corresponding to the distribution stage in software artifact supply chain integrity frameworks), distinct from build-stage and source-stage poisoning.

    5. User-Side Remediation Checklist

    If you used the affected IDE’s auto-update during the exposure window, take the following steps immediately:

    1. Verify extension versions: Uninstall any extensions falling within the affected version ranges and reinstall fixed versions from a trusted source;
    2. Inspect SSH authorized keys: Review each public key in your authorized_keys file and remove any entry whose origin you cannot confirm;
    3. Review SSH configuration and logs: Check authentication logs for login records from unknown sources;
    4. Rotate credentials: If the machine is used for development, assume SSH private keys may have been exposed and rotate relevant keys and access credentials;
    5. Check for lateral movement: Look for unusual outbound connections, scheduled tasks, or cron scripts in recent activity.

    6. Defense Recommendations for Enterprises and Platforms

    For enterprise developers:

    • Enable extension allowlisting for critical development environments to restrict what can be installed;
    • Add integrity monitoring and change alerts for SSH authorized key files in CI and developer machine baselines;
    • Isolate critical project build environments from personal IDE environments to limit the impact of a single point of compromise.

    For platforms and extension publishers:

    • Enforce multi-factor authentication for publishing and require signed artifacts, with signature verification enforced on the client at install time;
    • Have self-hosted marketplaces perform hash comparison on every artifact synced from upstream, and block anything whose hash does not match;
    • Build automated detection for version number discontinuities and anomalous publisher behavior to shorten the exposure window for malicious packages.

    7. Closing Thoughts

    The essence of this incident is an old saying in modern form: trust must be built on verifiable evidence, not on the reputation of a channel. For developers, regularly checking extension hashes and authorized keys should become a habit. For platforms, every hop in the auto-update pipeline needs integrity verification as a safety net. Supply chain attacks will not disappear, but a verifiable trust chain can shrink the attack window from hours to minutes.