Extension Marketplace Cache Poisoning: Backdoor Self-Audit and Remediation Guide
This article examines a distribution cache poisoning incident in an extension marketplace, explains why conventional typosquatting checks failed, details the malicious payload’s host reconnaissance, public-key insertion, remote-login service activation, reverse tunnel, and persistence behavior, and provides an exposure-assessment method, self-audit checklist, batch-audit pseudocode, removal and credential-rotation steps, supply-chain and endpoint hardening recommendations, and a risk-closure validation list.
1. Incident Nature: Not Same-Name Impersonation, but Distribution Cache Poisoning
The most common misunderstanding of this type of security incident is that “a user installed a same-name impersonating extension.” However, the disclosed attack chain shows that the problem was not extension-name or identifier impersonation. The distribution cache used by the extension marketplace was poisoned. What users saw was an ordinary version update of a legitimate extension: the extension name, identifier, and update entry point were all consistent with normal behavior. As a result, traditional checks such as “look at the name, icon, and download count” largely failed.
The attack chain can be abstracted into four stages:
- Access credential leakage: The attacker first obtained an access key held by a partner. The key was originally intended for limited access to resources shared by both parties.
- Sensitive data read from shared storage: A shared read-only storage bucket contained a small amount of tracing data, including unmasked credentials.
- Lateral movement into collaboration tools: The attacker used these credentials to enter some third-party collaboration tools and further obtain publishing or cache-operation capabilities.
- Distribution cache poisoning: The attacker placed a malicious copy directly into the distribution cache used by the extension marketplace, causing a specific version of a legitimate extension to be replaced by a malicious build for a short period.
Several boundaries need to be clear: the malicious copy was not published by the legitimate vendor and was not content from the upstream extension source; the upstream source never contained the malware; the issue was concentrated in two tampered cache versions and involved only two mainstream desktop operating systems. The extension marketplace later verified that other extensions were legitimate and reviewed and rebuilt the marketplace. This characterization is important because it determines that the investigation focus is not “find an impersonating extension,” but “confirm whether a poisoned cache version was pulled and executed within a specific time window.”
2. What the Payload Did: Information Collection, Public-Key Insertion, Persistence, and a Reverse Channel
From a defensive perspective, the malicious code’s goal was not one-time damage but the establishment of a long-lived remote-login backdoor. Its behavior can be divided into five categories:
- Host and user information reporting: It collected the hostname, username, operating system and architecture, home directory path, environment variable names, working directory, code-hosting account email, public network address, and similar information. This is enough to help an attacker build an asset profile and prepare for subsequent lateral movement.
- Remote-login public-key insertion: It attempted to append an attacker-controlled public key to the user’s authorized public key file, thereby obtaining passwordless login capability.
- Local remote-login service activation: It attempted to enable the local remote-login entry point, creating conditions for external connections.
- Reverse remote-login tunnel establishment: The victim host actively initiated outbound connections, bypassing some inbound restrictions and forming a reverse channel.
- Persistence and periodic retries: It established persistence in user-level autostart agents, system scheduled tasks, startup items, and similar locations; a background script retried tunnel establishment approximately every 60 seconds.
The disclosure also noted that the malicious code contained implementation errors. Unless the extension was launched with administrator privileges, key steps could fail, and the attacker could not log in through the tunnel. However, a failed tunnel does not mean the host is safe. Officially confirmed facts include that the extension had already attempted to add the attacker’s public key, install persistence mechanisms, and report host information. In other words, even if the reverse channel was not successfully established, the host may already contain the public key, autostart entries, and an independent payload.
More importantly, uninstalling the extension alone may not be enough. The payload releases an independent persistence script, and the script may continue to run after the extension is uninstalled. Response actions must therefore be upgraded from “delete the extension directory” to “trace the payload backward from autostart entry points, clean up public keys, disable unnecessary remote-login services, and rotate credentials.”
3. Impact Assessment: Time Window, Upper Bound, and Risk Classification
The key parameters in the advisory need to be understood separately:
- Time window: Approximately 11 hours, a short cache-poisoning window.
- Scope: Among users who requested the specific cache version of the extension that day, up to about 5,000 may have received the malicious build. This is an upper bound, not a confirmed number of compromised users.
- Follow-up handling: The attacker’s server was taken offline, rendering reverse connections and information reporting ineffective; a later observed attacker activity was blocked.
When assessing risk, enterprises should apply the “three-condition intersection” principle:
- The asset installed or updated the extension within the incident time window;
- The asset actually pulled the specific tampered cache version;
- The extension was executed, especially with administrator privileges.
The more conditions that are met, the higher the risk. Even if the third condition is not met, as long as abnormal scripts, autostart entries, or newly added authorized public keys appear in the extension directory, the host should be treated as “potentially affected.” If the host ever launched the extension with administrator privileges, it should be directly escalated to a high-risk host, prioritized for isolation and forensic collection, and rebuilt if necessary.
4. Self-Audit Checklist: From Extensions and Processes to Network and Public-Key Files
A self-audit should not only check whether an extension is installed. It should cover “payload landing points” and “persistence entry points.” Check the following items one by one:
| Check item | What to look for | Why it matters |
|---|---|---|
| Extension installation and update records | Whether the specific cache version was updated within the incident window | Confirms exposure conditions |
| Extension directory | Scripts, binaries, or configuration files unrelated to the extension’s function | Detects independent payloads |
| Process list | Abnormal processes that run periodically and whose commands point to user-writable directories | Detects background retries |
| Network connections | Periodic outbound connections, abnormal remote ports, or unknown processes connecting externally | Detects reverse channels |
| Autostart entries | New abnormal entries in user-level autostart agents, login items, system scheduled tasks, or startup items | Detects persistence |
| Authorized public key file | Unknown public keys, abnormal comments, or modification times within the window | Determines whether a backdoor key was written |
| Temporary and user directories | Randomly named scripts, hidden files, or recently modified persistence scripts | Detects residual payloads |
| Environment variables and configuration | Appended abnormal variables, proxy configuration, or path hijacking | Detects covert persistence |
| Logs and alerts | Records of periodic outbound connections, privilege escalation, service activation, or scheduled-task creation | Supports forensics and tracing |
| Credential exposure surface | Whether code-hosting tokens, cloud access keys, package-manager tokens, or collaboration-tool tokens may have been read | Determines rotation scope |
Important: if an unknown public key appears in the authorized public key file, it should be treated as a backdoor insertion even if the reverse tunnel was not successfully established. Likewise, the presence of an autostart entry means persistence has landed, and deleting only the extension directory is insufficient.
5. Batch Self-Audit Pseudocode Example
The pseudocode below illustrates batch investigation logic without relying on platform-specific commands. In practice, it can be mapped to enterprise endpoint management, host security, or log-search capabilities.
# Pseudocode: single-host self-auditdef audit_host(host):findings = []# 1. Check extension directory, user config directory, temp directory, and autostart directoryfor path in [extension_install_dir, user_config_dir, temp_dir, autostart_dir]:for f in list_files(path):if in_event_window(f.mtime) and contains_any(f.content,["remote login public key", "reverse tunnel", "periodic retry", "information reporting"]):findings.append(("suspicious file", f.path, f.mtime))# 2. Check autostart entries and scheduled tasksfor item in read_autostart_items():if item.command_points_to_user_writable_path() \and item.interval_seconds <= 60:findings.append(("suspicious persistence", item))# 3. Check periodic outbound connectionsfor conn in read_network_connections():if conn.direction == "outbound" \and conn.retry_interval_seconds <= 60 \and conn.process_path in user_writable_dirs:findings.append(("suspicious outbound connection", conn))# 4. Check newly added authorized public keysfor key in read_authorized_keys():if key.added_time in event_window or key.comment not in known_personnel:findings.append(("unknown public key", key.fingerprint))return findings
For batch execution, collect evidence before deletion. Preserve file hashes, paths, modification times, process command lines, network connection five-tuples, and autostart configuration for later review and forensic analysis.
6. Removal and Response Steps: Forensics First, Then Break the Chain, Finally Rotate Credentials
Removal should follow this order: “collect evidence before deleting; break persistence before deleting payloads; rotate credentials before restoring business.”
- Isolate the host but preserve evidence: Isolate high-risk hosts from critical networks instead of immediately formatting them. First collect processes, network connections, autostart entries, extension directories, scripts in temporary directories, authorized public key files, and recent logs.
- Uninstall the extension and pin versions: Uninstall the poisoned version and clean extension caches and update remnants. In enterprise environments, pause automatic updates and switch to whitelisted version pinning.
- Delete persistence entry points: Clean user-level autostart agents, login items, system scheduled tasks, startup items, and service entries one by one. Do not delete only script files; trace backward from autostart entry points to the payload paths they invoke.
- Clean authorized public keys: Delete unknown public keys and verify public-key fingerprints against the known-personnel list. If confirmation is impossible, reset remote-login credentials for the affected accounts.
- Disable unnecessary remote-login services: Confirm whether the local remote-login service was unexpectedly enabled. Disable it if unnecessary and restrict inbound access.
- Delete independent payloads: Clean randomly named scripts, hidden files, and downloaders in temporary directories, user directories, and configuration directories. Recheck for periodic retry logic.
- Rotate all potentially exposed credentials: This includes code-hosting tokens, cloud access keys, package-manager tokens, collaboration-tool tokens, and continuous-integration credentials. Do not only change passwords; key-based credentials must be revoked and reissued.
- Rebuild high-risk hosts: If the host ever ran the extension with administrator privileges, or if a public key was written and unknown outbound connections exist, prioritize rebuilding rather than “cleaning and continuing to use.”
- Validate and observe: After reboot, recheck autostart entries, public-key files, outbound network connections, and extension directories. Observe logs for 7 to 30 days to confirm there are no periodic retries or abnormal logins.
7. Supply-Chain and Endpoint Hardening Recommendations
The root cause of such incidents lies in supply-chain access control and distribution cache integrity. Endpoint cleanup alone can stop losses but cannot prevent recurrence. Harden from three sides:
- Distribution side: Caches should be immutable, and in-place overwrites after publication should be prohibited. Releases should be signed and hashes verified. Release approval and cache writes should use two-person review. Partner access keys should be short-lived, least-privileged, and isolated by resource granularity. Tracing data in shared storage must be masked, and plaintext credentials must not be stored there.
- Client side: Enterprises should pin extension versions, establish whitelists, and delay nonessential updates. Review extension permissions and restrict their ability to access user directories, autostart entries, and the network. Enable runtime behavior monitoring, focusing on high-risk behaviors such as periodic outbound connections, public-key file modifications, and autostart entry creation.
- Enterprise operations side: Establish asset inventories and extension ledgers, and centrally collect endpoint logs, network logs, and identity logs. Set alerts for “distribution cache updates,” “scheduled-task creation,” “authorized public-key modification,” and “abnormal outbound connections.” Regularly exercise isolation, forensic collection, cleanup, and credential rotation processes for supply-chain poisoning scenarios. If an organization uses Baidu AI Cloud, it can combine its general log service, key management, and host security capabilities for centralized auditing and alerting, subject to actual product capabilities.
8. Validation and Retrospective Review: Upgrade “Uninstall Completed” to “Risk Closed”
Before closing the response, complete a verifiable closure checklist: the extension has been uninstalled and its version pinned; autostart entries and scheduled tasks are normal; the authorized public key file contains no unknown public keys; the local remote-login service status matches the baseline; there are no periodic outbound connections or suspicious processes; all potentially exposed credentials have been rotated; high-risk hosts have been rebuilt or undergone in-depth forensic collection; and no recurrence signs appear during the log observation period.
During the retrospective review, answer three key questions: Was the asset exposed within the window? Was persistence truly removed? Did credential rotation cover the full scope? Only when all three items are closed can “the extension was uninstalled” be upgraded to “the risk has been closed.”
