Supply Chain Attack via Malicious VS Code Extension: Up to 5,000 Users Affected

    This article breaks down a multi-stage software supply chain attack in which a tampered Claude Code extension was briefly published in a VS Code extension marketplace, exposing trace data for fewer than 0.05% of non-privacy-mode users. It covers the full attack chain, why extension marketplace trust models and leaked API keys are the root risks, a self-check checklist for affected users, and layered defense practices for teams.

    Malicious Extension Affects Up to 5,000 Users

    1. Incident Overview: A Typical Software Supply Chain Security Event

    An AI coding tool recently discovered and removed a malicious, unauthorized copy of the Anthropic Claude Code extension from its VS Code extension marketplace. After a two-week investigation, the full findings were disclosed on November 13.

    The investigation concluded that the vast majority of customers were not affected, with the number of impacted users capped at 5,000. Affected customers have been contacted individually and informed of the relevant details. Key findings include:

    • Privacy mode protection: For users with privacy mode enabled, prompts and code content were not affected.
    • Very low rate of trace data exposure: Among users without privacy mode, less than 0.05% had AI coding agent trace data leaked.
    • Notification mechanism: Cursor has confirmed affected users and notified them individually; if you did not receive a notification, your data was not in the leaked scope.

    On the surface, this was an “extension marketplace poisoning” incident. A closer look shows it was in fact a multi-stage supply chain attack triggered by a leaked key. The attack chain was complete and tightly linked at every stage, making it a representative example of security risks in today’s AI coding tool ecosystem.


    2. Timeline and Attack Chain Breakdown

    Based on the disclosed information, the attack can be reconstructed in five stages:

    Stage 1: Key Leakage — The Initial Entry Point

    The attacker used a leaked access key from an AI model provider (Fireworks) to steal part of the data in Cursor’s shared storage bucket. That data included a small number of unredacted internal credentials.

    Scope of impact: fewer than 0.01% of customers affected

    This is the starting point of the entire chain. Key leakage is dangerous precisely because it is often “silent” — the attacker needs no brute force or social engineering, only an already-exposed credential to enter the system with a legitimate identity.

    Stage 2: Lateral Movement — From Storage to SaaS Tools

    Using the stolen internal credentials, the attacker compromised some of Cursor’s SaaS tools and accessed:

    • Some non-production code repositories
    • Customer support data
    • Some user credentials

    The attacker used internal credentials rather than an external vulnerability, meaning traditional perimeter firewalls and WAFs could not block it — from the system’s perspective, this was a “normal internal access.”

    Stage 3: Malicious Extension Injection — Supply Chain Poisoning

    On October 29, the attacker used the stolen internal credentials to inject a tampered version of the Anthropic Claude Code extension into the Cursor extension marketplace. This was the stage with the widest impact in the entire incident.

    Key details:

    • The extension had no connection to Anthropic or Open VSX (the open-source VS Code extension marketplace)
    • The malicious version existed for about 11 hours
    • It affected at most 5,000 users
    • The malicious versions were Anthropic.claude-code 2.1.312 and 2.1.313

    Stage 4: Incident Response — Containment and Recovery

    After detecting the anomaly, Cursor took the following actions:

    1. Immediately disabled the leaked key
    2. Rotated all related credentials
    3. Cut off unauthorized access
    4. Proactively shut down some internal and product services
    5. Gradually restored services after confirming safety
    6. Removed the malicious extension and temporarily took the entire extension marketplace offline
    7. Worked with the cloud provider to shut down the attacker’s servers

    Stage 5: Customer Notification and Continued Monitoring

    • October 30: Published a security advisory and notified affected parties
    • November 1: Blocked the last attack and confirmed the incident was under control
    • November 13: Published the full investigation results

    3. Technical Deep Dive: Why Are These Attacks So Dangerous?

    3.1 Trust Model Flaws in Extension Marketplaces

    The trust model of IDE extension marketplaces (such as the VS Code Extension Marketplace and Open VSX) is essentially one-way trust based on publisher identity: users assume that extensions listed in the marketplace have been reviewed and come from trusted publishers. In reality:

    • Extension review focuses mainly on “whether it is malicious,” not “whether it has been tampered with”
    • Once an attacker obtains publisher credentials, they can upload arbitrary code under a legitimate identity
    • There is almost no secondary verification on the user side (such as code signature validation or source confirmation)

    This is why the attacker was able to keep a malicious extension “legitimately” listed in the marketplace for 11 hours — the system treated it as a normal publishing operation.

    3.2 Data Flow Differences in Privacy Mode

    Understanding the key difference that “whether privacy mode is enabled” makes to the scope of impact requires understanding the data flow of AI coding tools:

    1. User code → AI coding assistant → Model inference service → Results returned
    2. ↓
    3. Trace Data
    4. ├── Prompt
    5. ├── Code Snippet
    6. └── Context
    • Privacy mode enabled: Prompts and code do not enter trace storage, or are redacted when stored.
    • Privacy mode disabled: Full prompts and code context enter the trace system.

    In this incident, unredacted data stored in the trace system was stolen, leading to context exposure for 0.05% of users. This also explains why the official statement emphasized that “if you did not receive a notification, your data is not in this trace data.”

    3.3 Systemic Risks in Key Management

    The starting point of the entire incident was the “Fireworks key leakage.” This reflects a common engineering problem:

    1. # Anti-pattern: credentials hardcoded or stored in a shared storage bucket
    2. FIREWORKS_API_KEY = "fw-xxxxxxxxxxxxxxxx" # ❌
    3. # Correct approach: use a secrets manager + least privilege + regular rotation
    4. import boto3
    5. client = boto3.client('secretsmanager')
    6. response = client.get_secret_value(SecretId='prod/ai-model-api-key')
    7. api_key = response['SecretString']

    The root reasons a key leak could escalate into a major security incident:

    1. Unredacted credential storage: Unencrypted access keys were stored in a shared storage bucket.
    2. Blurred permission boundaries: A key for an AI model provider could access internal SaaS tools and code repositories.
    3. Lack of anomaly detection: The key abuse was not detected in time.

    4. User Impact Assessment and Self-Check Guide

    4.1 Affected User Profile

    User Type Affected? Details
    Users with privacy mode enabled ❌ Not affected Prompts and code not affected
    No privacy mode + malicious extension not installed ❌ Not affected Data not in the leaked trace data
    No privacy mode + malicious extension installed ⚠️ Needs review Trace data may have been leaked (<0.05%)
    Malicious extension installed (any mode) ⚠️ Needs action Check extension permissions and runtime behavior

    4.2 Self-Check Checklist

    If you use a VS Code extension for an AI coding tool, run the following checks immediately:

    Step 1: Confirm the extension version

    1. # Run in VS Code
    2. code --list-extensions --show-versions | grep -i claude
    3. # Or check the version of Anthropic.claude-code in the extensions panel
    4. # Malicious versions: 2.1.312 and 2.1.313

    Step 2: Check for abnormal behavior

    • Did the extension request permissions beyond expectations (such as full file system read access or outbound connections to unknown domains)?
    • Are there abnormal API calls or data transfers?
    • Is the editor experiencing unexplained latency or freezes?

    Step 3: Rotate related keys

    1. # If you configured an API key in the extension
    2. # 1. Revoke the old key in the provider's console
    3. # 2. Generate a new key and reconfigure it
    4. # 3. Check key usage logs for abnormal calls

    Step 4: Review recent code changes

    • Check for code commits or modifications from unknown sources
    • Confirm that configuration files such as package.json and tsconfig.json have not been tampered with

    ⚠️ Important reminder: Simply uninstalling the extension does not fully eliminate the risk. The malicious extension may have already modified local files or stolen and exfiltrated credentials while running. Uninstalling is only the first step in limiting damage; a full system review is still required.


    5. Enterprise-Level Defense Recommendations

    This incident is a warning not only for individual developers but also for enterprise teams. Here are layered defense recommendations:

    5.1 Extension Supply Chain Management

    1. # .vscode/settings.json - extension allowlist policy
    2. {
    3. "extensions.autoCheckUpdates": false,
    4. "extensions.autoUpdate": false,
    5. "extensions.ignoreRecommendations": true,
    6. // Only allow extensions from trusted publishers
    7. "extensions.allowed": [
    8. "ms-python.python",
    9. "ms-vscode.cpptools",
    10. // ... list of extensions that passed security review
    11. ]
    12. }

    Recommended measures:

    • Establish an internal extension allowlist and prohibit installing extensions that have not been reviewed
    • Regularly audit the list of extensions installed in development environments
    • Apply least privilege for critical development roles and restrict extension installation permissions

    5.2 Key and Credential Management

    • Never store unredacted credentials in shared storage: Use a key management service (KMS/Secrets Manager) for unified management.
    • Rotate credentials regularly: A rotation cycle of no more than 90 days is recommended.
    • Least privilege: Credentials between different services should be strictly isolated; a key for service A should not be able to access service B’s resources.
    • Enable credential usage auditing: Log and alert on the call behavior of all API keys.

    5.3 Monitoring and Anomaly Detection

    • Build baseline models for internal credential usage and trigger alerts on deviations.
    • Require two-person approval plus code signature validation for extension marketplace publishing operations.
    • Apply redacted storage and access auditing for trace data.
    • Establish an incident response plan with clear containment procedures and notification mechanisms.

    5.4 Developer Security Awareness

    • Enable privacy mode in AI coding tools (especially when handling enterprise code).
    • Do not paste sensitive information into prompts (API keys, database passwords, personal information, etc.).
    • Regularly review the permission configuration and data flows of AI coding tools.
    • Follow vendor security advisories and update or take action promptly.

    6. Reflection and Industry Implications

    6.1 Key Leakage Is the “Achilles’ Heel” of Supply Chain Security

    The source of this incident was not a sophisticated technical vulnerability but a leaked API key. This reminds every development team: the weakest link in security is often not the firewall or encryption algorithm, but credential management.

    According to industry security reports, more than 60% of data breaches involve credential abuse. Key management should be raised to the same priority as secure coding.

    6.2 The AI Coding Tool Ecosystem Needs Stricter Governance

    As AI coding assistants become widespread, their extension ecosystems are becoming a new attack surface. Traditional IDE extension risks (malicious code, permission abuse) are compounded by AI-specific risks (prompt leakage, context data outflow), making protection exponentially harder.

    The industry needs:

    • Extension publisher identity verification: Mandatory code signing and publisher authentication.
    • Extension behavior sandboxing: Monitor and restrict extension runtime behavior.
    • User-side transparency: Let users clearly know what data an extension accesses and where it is sent.

    6.3 Privacy Mode Should Not Be an “Option”

    In this incident, whether privacy mode was enabled directly determined whether a user was affected. In reality, however, many developers are unaware of the importance of privacy mode, or disable it because of the functional limitations it may bring.

    AI coding tool vendors should:

    • Make privacy protection the default behavior, not an option.
    • Apply end-to-end redaction to trace data.
    • Clearly show users the data flow path and storage locations.

    7. Conclusion

    Although this security incident affected a limited number of users (at most 5,000, with an actual trace data leak rate below 0.05%), the problems it exposed deserve industry-wide reflection:

    1. Key management is the cornerstone of supply chain security — a single leaked key can trigger a complete attack chain from data theft to marketplace poisoning.
    2. The extension marketplace trust model needs to be rebuilt — shifting from “trust the publisher” to “verify every release.”
    3. Privacy protection should be the default configuration — not an “optional feature” that users must actively enable.
    4. Incident response speed determines the scale of loss — detecting and removing the malicious extension within 11 hours demonstrates the value of automated monitoring.

    For developers, the biggest lesson from this incident is: while enjoying the efficiency gains of AI coding tools, do not ignore the security risks behind them. Regularly auditing extensions, safeguarding keys, and enabling privacy mode — these seemingly simple actions are often the first line of defense against supply chain attacks.