A significant software supply chain attack has been identified targeting the npm ecosystem, attributed to the threat actor TeamPCP. A report from Palo Alto Networks' Unit 42 details a malicious package, @bitwarden/cli, that impersonates the legitimate Bitwarden password manager CLI. This attack represents a dangerous evolution in supply chain threats, combining social engineering, advanced obfuscation, and a wormable propagation mechanism. The malware's primary objective is widespread credential harvesting from developer environments, including local files, CI/CD systems, and major cloud providers like AWS, Azure, and Google Cloud. The incident underscores the critical risk posed by compromised dependencies, as a single infected developer can inadvertently spread the malware throughout their organization's software projects and into the broader open-source community.
The attack, reminiscent of the infamous Shai-Hulud worm of 2025, leverages the trust inherent in the software development lifecycle. TeamPCP published a malicious package named @bitwarden/cli with version 2026.4.0 to the public npm registry. Developers installing this package, believing it to be the official tool, would unknowingly trigger a multi-stage attack.
npm install command.preinstall hook in the package's package.json file automatically executes a bootstrap script, bw_setup.js. This script also registers itself as the bw command, ensuring it runs even if the user disables installation scripts..npmrc, .git-credentials), environment variables, and secrets stored in AWS Systems Manager, Azure Key Vault, and Google Secret Manager.audit.checkmarx[.]cx.The campaign was part of a broader effort targeting security tooling vendors, with Checkmarx, Trivy, and LiteLLM also being targeted by TeamPCP.
The attack showcases a high degree of sophistication in its execution and evasion techniques.
The malware ensures its execution through two primary methods within the package.json file:
preinstall hook: This script runs automatically upon npm install, providing an immediate entry point.bin field: The package registers the malicious bw_setup.js script as the bw command. This acts as a secondary trigger, executing the malware whenever a user or script invokes the bw command, bypassing protections like npm install --ignore-scripts.This dual-trigger mechanism demonstrates a deep understanding of the npm ecosystem and is a key technique for achieving persistence and ensuring execution.
TeamPCP employed multiple layers of obfuscation (T1027 - Obfuscated Files or Information) to hinder analysis:
audit.checkmarx[.]cx was stored as a sequence of hex values [0x42, 0x6e, 0x36, 0x4b, 0x2b, 0x5c, 0xd, 0x57, 0x0, 0xd, 0x7, 0x26, 0x42, 0x3, 0x2a, 0x5c, 0xd, 0x2a].The payload is a comprehensive credential harvesting tool (T1552.001 - Credentials In Files, T1552.005 - Cloud Credentials) targeting various sources:
.npmrc, .bash_history, .zsh_history, SSH keys, and Git credentials.gh auth token to steal the active GitHub CLI token and captures all environment variables.The malware's most destructive feature is its wormable propagation, a clear instance of T1554 - Compromise Software Supply Chain. By using stolen npm and GitHub tokens, it automates the compromise of additional software packages, creating a cascading failure of trust within the ecosystem.
The potential impact of this campaign is severe and widespread. A single compromised developer can trigger a chain reaction, leading to:
audit.checkmarx[.]cx@bitwarden/cli@2026.4.0bw_setup.jsmcpAddon.jsSecurity teams may want to hunt for the following patterns, which could indicate related activity:
audit.checkmarx[.]cxnode.exe -> gh auth tokenpackage.json with preinstall scripts executing unknown JS filespreinstall, install, and postinstall hooks in dependency manifests.node_modulesnpm publish eventsaudit.checkmarx[.]cx. Use Network Traffic Analysis to detect anomalous outbound connections from build servers and developer machines.npm or node processes accessing sensitive files or executing shell commands like gh auth token. Use Process Analysis to baseline normal developer activity.M1032 - Multi-factor Authentication).--ignore-scripts: While not foolproof, running npm install --ignore-scripts can prevent many attacks that rely on preinstall or postinstall hooks. This should be combined with other defenses.package-lock.json to prevent unexpected updates.Restrict permissions for developer and CI/CD accounts to limit the blast radius. Use short-lived, scoped tokens for publishing.
Enforce MFA on npm, GitHub, and other developer platform accounts to prevent takeover via stolen credentials.
Mapped D3FEND Techniques:
Implement egress filtering to block outbound connections from build servers and developer workstations to known-bad or unauthorized domains.
Mapped D3FEND Techniques:
Log and monitor all npm activity, especially package publications and permission changes, to detect anomalous behavior.
Prevent the automatic execution of package installation scripts using mechanisms like `npm install --ignore-scripts`.
Use dependency analysis tools to audit packages for known malicious publications and ensure only vetted versions are used.
Mapped D3FEND Techniques:
Train developers to be vigilant against typosquatting and to verify the authenticity of packages before installation.
Integrate automated dependency analysis tools directly into the CI/CD pipeline and developer IDEs. These tools should perform static and dynamic analysis on npm packages to identify malicious characteristics. Specifically for this threat, rules should be configured to flag packages containing preinstall or postinstall scripts that execute obfuscated code, packages with unusually large file sizes (like the 10MB payload observed), and packages that attempt to read sensitive files like .npmrc or SSH keys. Tools like Socket or Snyk can be configured to scan package.json and package-lock.json files on every commit, preventing a malicious package like @bitwarden/cli from ever being introduced into the codebase. The analysis should also check for typosquatting by comparing package names against a list of popular, legitimate packages.
Deploy network monitoring and egress filtering, particularly for build environments and developer workstations. All outbound traffic should be inspected, and connections to known malicious domains like audit.checkmarx[.]cx must be blocked at the network perimeter. Beyond simple blocklists, organizations should baseline normal network behavior for their development tools. For example, an npm install process should only connect to the official npm registry or a private internal registry. Any connection attempts from node.exe or build agents to unusual external IP addresses should trigger a high-priority alert. This technique is crucial for detecting C2 communication and data exfiltration, serving as a last line of defense if a malicious package is executed.
Strictly enforce the Principle of Least Privilege for all accounts involved in the software development lifecycle. For this specific threat, this means ensuring that npm tokens used in CI/CD pipelines are read-only by default. A separate, tightly controlled process with short-lived, write-scoped tokens should be used for publishing packages. Developer GitHub accounts should not have organization-wide write access unless absolutely necessary. By limiting the permissions of the accounts that the malware compromises, the wormable propagation feature of this threat is effectively neutralized. An attacker might steal a token, but if that token doesn't have permission to publish new packages, the attack is contained to the initially compromised host.
The Shai-Hulud worm incident marks a turning point in npm security, beginning the era of high-consequence threats.
TeamPCP reportedly targets infrastructure of security vendors Checkmarx, Trivy, and LiteLLM.
Unit 42 publishes their analysis of the malicious '@bitwarden/cli' npm package and the broader TeamPCP campaign.

Cybersecurity professional with over 10 years of specialized experience in security operations, threat intelligence, incident response, and security automation. Expertise spans SOAR/XSOAR orchestration, threat intelligence platforms, SIEM/UEBA analytics, and building cyber fusion centers. Background includes technical enablement, solution architecture for enterprise and government clients, and implementing security automation workflows across IR, TIP, and SOC use cases.
Help others stay informed about cybersecurity threats