Editor Extension Supply Chain Poisoning: How to Detect and Remove the SSH Backdoor
This article walks through a real editor extension supply chain poisoning incident in which a tampered build of a popular code agent extension was distributed through a marketplace cache. It reconstructs the attack chain from a leaked access key to cache poisoning, breaks down the payload's three behaviors (host information reporting, an SSH backdoor attempt, and persistence), and provides a step-by-step self-check and cleanup guide for macOS and Windows. It closes with hardening practices around least privilege, credential hygiene, and supply chain awareness.
1. Incident Recap: Poisoning Hidden Behind a “Routine Version Update”
A security advisory from a smart coding tool provider, along with its follow-up investigation updates, disclosed that an unauthorized malicious copy of an extension had been mixed into the distribution cache of its extension marketplace on a specific date. The tampered file corresponded to a mainstream code agent extension, covered two adjacent version numbers, and was limited in scope to specific desktop operating systems (Windows and macOS).
It’s worth clarifying the nature of the incident first, to avoid misjudging it:
- This was not a separately published, look-alike extension of the same name. The attackers tampered with the build artifact of the legitimate extension inside the distribution cache. As a result, the name, identifier, icon, and even the update prompt that users saw were identical to the genuine product. The only difference was that “this was just a normal version update.”
- This was not a vulnerability in the extension developer’s own product. The malicious copy was neither built nor published by the developer.
- The upstream public source of the extension marketplace never contained the malicious sample. The contamination happened only at the downstream distribution cache stage.
A few key parameters from the official advisory are worth remembering:
- Time window: roughly 2:27 AM to 1:35 PM (Pacific Time) that day, lasting about 11 hours.
- Upper bound of impact: among users who requested the affected cached version of the extension that day, at most around 5,000 may have received the malicious build. Note that this is an upper bound, not a confirmed count of actual victims.
2. Reconstructing the Attack Chain: From Credential Leak to Distribution Poisoning
Understanding this chain is the key to understanding why “supply chain attacks” are so dangerous. Based on the investigation updates, the attack path was roughly as follows:
- The attackers first obtained an access key that the tool provider had issued to a partner.
- Using that key, they read a read-only storage bucket shared between the two parties. A small amount of historical agent trace data in the bucket contained unredacted credentials.
- Using these stolen credentials, the attackers gained further access to some of the SaaS services the tool provider relied on.
- Finally, using these credentials, the attackers wrote the malicious copy directly into the distribution cache used by the extension marketplace.
The core lesson of this chain is that a seemingly harmless combination of “an access key plus unredacted logging credentials,” after multiple stages of amplification, ultimately evolved into distribution poisoning targeting end users. Credential minimization, redaction of sensitive information in logs, and isolation of trust boundaries across systems—the absence of any one of these can become the first domino to fall.
3. What the Malicious Payload Did: Reporting, a Backdoor, and Persistence
Breaking the payload down from a defensive perspective, its behavior falls into three layers:
Layer 1: Host and user information reporting. The payload collects and exfiltrates the following: hostname, username, operating system and architecture, home directory path, environment variable names (not their values), the current working directory, the Git email, and the public IP. This information is enough to build a profile of the target machine and lay the groundwork for a more precise attack later.
Layer 2: Attempting to establish an SSH backdoor. The payload appends the attacker’s SSH public key to authorized_keys, tries to enable the local SSH service, and sets up a reverse SSH tunnel. According to the official statement, because of flaws in the malicious code itself, this step fails unless the tool is launched with administrator privileges (which is very rare), and the attacker cannot log in through the tunnel either.
Layer 3: Persistent residence. On macOS this is achieved via a LaunchAgent; on Windows it is done through a scheduled task (attempting to run as SYSTEM, with a startup item as a fallback). The background script retries establishing the tunnel roughly every 60 seconds.
The key takeaway: tunnel failure ≠ safety. Even though the reverse tunnel usually cannot be established due to the flaws, the official statement explicitly confirms that the attacker’s public key has been written, the persistence mechanism has been installed, and the host information has been reported. More dangerously, the payload drops a separate persistence script that keeps running in the background and retrying the connection even after you uninstall the extension. Therefore, “I didn’t see any anomalous connections” is not a valid basis for concluding that you’re safe.
It’s also necessary to distinguish between two points in time: on the day of the incident, the attacker’s server was taken offline with the cooperation of its cloud provider, so the reverse connections and information reporting stopped. However, a later investigation update indicated that the last observed attacker activity took place about two weeks afterward and had been blocked. Taking the server offline reduced the immediate risk, but it does not automatically remove the public key and persistence items that have already landed on your machine.
4. Self-Check Checklist: Confirming Whether You Are Affected
Work through the following steps in order: whether you hit an affected version → check for backdoor traces → check for persistence.
1. Confirm the version. Check the version number of the code agent extension in the extension management interface. If you were on an affected version during this period, you need to continue investigating (note: even if it has since auto-updated to a clean version, the old payload may still linger).
2. Check the SSH authorized keys. Look for unfamiliar public key entries:
# View the current user's authorized keyscat ~/.ssh/authorized_keys# Check whether the file's modification time falls near the suspicious time windowls -la ~/.ssh/authorized_keys
For each public key you don’t recognize, verify its origin one by one. In a normal environment, entries you never added should not appear here.
3. Check persistence items (macOS).
# List the user-level LaunchAgents directoryls -la ~/Library/LaunchAgents/# Show loaded and running jobslaunchctl list
Pay close attention to entries with random-looking names that point to /tmp, to temporary scripts under ~/Library, or to suspicious .sh/.plist files.
4. Check persistence items (Windows; run in an administrator PowerShell).
# List scheduled tasks in the Ready stateGet-ScheduledTask | Where-Object {$_.State -eq "Ready"} | Format-Table TaskName, TaskPath# Check suspicious registry startup entriesGet-CimInstance Win32_StartupCommand | Format-List Name, Command, Location
5. Check residual processes and outbound connections.
# Find suspicious SSH/tunnel-related connectionslsof -i -P | grep -i sshps aux | grep -iE 'ssh|autossh' | grep -v grep
# Check connections on suspicious portsnetstat -ano | findstr :22
5. Cleanup Steps: Fully Removing the Residue
Once you find traces, uninstalling the extension alone is not enough—you must also clean up the independent persistence script and the backdoor:
- Terminate suspicious processes: find and kill the background script process that retries every 60 seconds.
- Delete persistence items: remove the corresponding LaunchAgent (the
.plistunder~/Library/LaunchAgents/along withlaunchctl unload) or the Windows scheduled task (Unregister-ScheduledTask), and clear any registry startup entries as well. - Remove the malicious public key: delete the attacker’s public key from
authorized_keys. - Reinstall the extension: uninstall the affected extension copy and reinstall a verified version from a trusted source.
- Rotate credentials (the most critical step): since the host information has already been reported, you should immediately rotate the SSH keys, access tokens, and sensitive credentials associated with that machine, and check whether they have been reused elsewhere.
6. Defense Hardening: Preventing This Class of Risk from Recurring
- Least privilege principle: Do not launch your editor and development tools with administrator/root privileges. In this incident, the tunnel’s failure was precisely thanks to running without administrator privileges, which shows that shrinking privileges is itself an effective line of defense.
- Credential and log governance: Unredacted credentials must never remain in trace or other debugging data. Access keys should be granted minimal authorization and rotated regularly, and shared storage buckets should be subject to strict access auditing. In the cloud, you can rely on object storage access controls, operation auditing and monitoring alerts from logging services (such as the general-purpose log auditing and permission management capabilities offered by Baidu AI Cloud) to detect anomalous read behavior promptly.
- SSH key hygiene: Audit
authorized_keysregularly with zero tolerance for unknown entries. You can combine this with file integrity monitoring to alert immediately when a key file is modified. - Supply chain awareness: Stay attentive to extension updates and follow official security advisories. Build a habit of integrity verification for distribution caches and dependency sources, and understand that “a clean upstream does not mean a trustworthy downstream.”
The essence of a supply chain attack is that the attacker delivers malicious code through an update channel you trust. The focus of defense should not stop at “antivirus after the fact,” but should shift forward to credential minimization, privilege reduction, and continuous monitoring—only by tightening the trust boundary at every stage can you cut off this kind of progressively amplified attack chain.
