AI Coding Plugin Poisoning Incident: Post-Mortem and a Four-Step Self-Check
This article reviews a real AI coding plugin poisoning incident, tracing how a leaked credential escalated into tampered plugin packages in a marketplace cache. It explains how to determine whether you are affected using three conditions (time window, install source, and operating system), then walks through a four-step self-check covering plugin version confirmation, SSH authorized_keys inspection, persistence scanning, and cleanup with credential rotation. It closes with root-cause analysis and enterprise hardening recommendations for credential governance, privacy defaults, plugin admission, and observability.
1. Incident Timeline: How a Leaked Credential Became a Plugin Poisoning Attack
At its core, this security incident was a multi-stage chain: credential leak → session data exposure → lateral movement into SaaS tools → plugin tampering and entry into the distribution cache. The vendor of an AI coding tool published its investigation findings through official channels: an access key issued to an upstream compute partner was leaked on the partner’s side. The attacker used it to read agent session records, mostly from a particular year, that had not been created in privacy mode. A small number of those records contained unredacted credentials. The attacker then used those credentials to reach several SaaS tools the vendor relied on, and ultimately wrote two consecutive tampered versions of an open-source coding agent plugin into the marketplace’s cache layer.
Key timeline points (approximate ranges, meant to establish the concept of a risk window):
- Key leak and data access: occurred several weeks before public disclosure, forming a dormant period;
- Lateral movement: the attacker used plaintext credentials found in session records to access internal tools;
- Poisoning window: the tampered packages survived in the marketplace cache for about 11 hours;
- Scope: up to roughly 5,000 users may have installed a tampered version;
- Responsibility boundary: the upstream open-source plugin repository was not poisoned; what was tampered with was the distribution package in the cache layer. The editor client and the official update channel were not affected.
What developers should find most alarming here is not the breach itself but how plausible the attack path is: agent session records naturally contain commands, file paths, temporary tokens, and other sensitive context. Without redaction and privacy-mode protection, they become a high-value intelligence source.
2. Determining Whether You Are Affected: All Three Conditions Must Hold
To avoid pointless investigation, start with an intersection test based on three conditions: time + source + platform.
- Time window: 02:27 to 13:35 Pacific Time on the 29th of a given month (17:27 that day to 04:35 the next day Beijing Time);
- Install source: the specified coding agent plugin was installed or updated from within that editor’s plugin marketplace (automatic updates count too);
- Operating system: only macOS and Windows are affected; Linux is not in the batch of tampered packages.
If any single condition is not met, the risk is very low. If all three are met, move on to technical verification.
3. The Four-Step Self-Check: From Version to Persistence
Step 1: Confirm the plugin version on your machine
Plugin directory layouts differ across platforms, so cross-verify with either the file system or the command line:
# Option 1: inspect the plugin directory directlyls ~/.cursor/extensions | grep -i "anthropic.claude-code"# Option 2: list installed extensions and versions via CLIcursor --list-extensions --show-versions | grep -i claude-code
If the version is 2.1.312 or 2.1.313 and the install time falls inside the risk window, treat it as high risk.
Step 2: Check whether a public key was appended to your SSH authorized list
One core behavior of the malicious plugin is appending the attacker’s public key to the SSH authorized keys file, with the comment field set to svc-telemetry. This is the most direct indicator.
# macOS / Linuxgrep -qs svc-telemetry ~/.ssh/authorized_keys \&& echo "Suspicious public key found" \|| echo "Not found; this machine is unaffected"
# Windows PowerShell$files = "$HOME\.ssh\authorized_keys","C:\ProgramData\ssh\administrators_authorized_keys" |Where-Object { Test-Path $_ }if ($files -and (Select-String svc-telemetry $files)) {"Suspicious public key found"} else {"Not found; this machine is unaffected"}
Step 3: Scan for persistence artifacts
Attackers typically drop hidden configuration files to maintain access. Focus on hidden entries in user configuration directories, startup items, and scheduled tasks:
ls -la ~/.config/ | grep -E "^\." # look for abnormal hidden directoriescrontab -l # check for abnormal scheduled tasks
On Windows, check Task Scheduler and registry startup entries for unsigned items or entries with suspicious paths.
Step 4: Clean up and rotate
If any indicator is hit, handle it in this order:
- Disconnect from the network and preserve logs for evidence;
- Remove the tampered plugin and clear related cache directories;
- Remove the
svc-telemetrypublic key and all suspicious persistence items; - Rotate SSH keys, access tokens, cloud access keys, and SaaS sessions;
- Review recent activity logs to confirm whether any abnormal data access occurred.
4. Root Cause: Why Risk Is Amplified in the Agent Era
Traditional supply chain attacks depend on build systems and package repositories. Agent toolchains shift the risk forward to the “context layer.” Session records contain code snippets, environment variables, internal domains, and temporary credentials. Once privacy mode is off and redaction is missing, a leak is equivalent to handing over a map of the internal network. The defensive focus should therefore shift from “endpoint antivirus” to “credential governance + context minimization.”
5. Enterprise Hardening Recommendations
- Credential governance: short-lived tokens, least-privilege authorization, centralized custody with automatic rotation; never paste keys in plaintext into sessions;
- Privacy on by default: do not retain sessions by default and redact by default; use localized or dedicated deployment options for sensitive projects;
- Plugin admission: maintain an internal plugin allowlist with version pinning, disable automatic updates, and validate in an isolated environment first;
- Observability: combine log services with monitoring and alerting, and build baseline alerts for authorized key file changes, abnormal outbound connections, and new scheduled tasks;
- Cloud-side protection: layer defenses using common capabilities such as container platforms with image scanning, key management, and bastion hosts;
- Drill mechanism: run supply chain poisoning drills regularly to shorten detection and rotation time.
6. Conclusion
The biggest lesson from this incident is that the convenience of AI coding tools rests on large amounts of context, and context is the new attack surface. Developers should make version verification, authorized key file checks, persistence scanning, and credential rotation standard practice; enterprises should fold plugin admission and credential governance into their R&D security baseline. If you need elastic compute and complete cloud security capabilities to support this, you can look into Baidu AI Cloud’s general-purpose products and best practices to build a sustainable supply chain defense system.
