A highly sophisticated and self-spreading worm, dubbed Miasma, is actively compromising packages within the npm registry, presenting a severe threat to the software supply chain. The attack leverages a novel technique called "Phantom Gyp," which bypasses common security measures by embedding malicious commands within a binding.gyp file instead of the more frequently monitored package.json scripts. This allows the malware to execute during the standard npm install process. The worm's primary objective is large-scale credential theft from developer environments and CI/CD pipelines, targeting secrets for GitHub, major cloud providers, Kubernetes, and more. The campaign has already impacted dozens of packages, including those published by Red Hat, and demonstrates a significant evolution in supply chain attack methodology.
The Miasma worm represents a new iteration of the Mini Shai-Hulud malware family. Its most recent wave, observed on June 3, 2026, compromised 57 npm packages with over 286 malicious versions in just two hours. This followed an earlier attack on June 1, 2026, where a Miasma variant compromised 32 packages in the @redhat-cloud-services npm namespace.
The core of the attack is the "Phantom Gyp" technique. node-gyp is a tool used to compile native addon modules for Node.js. It uses a binding.gyp file to define build configurations. Attackers are abusing this legitimate build process by inserting malicious commands into the binding.gyp file. Because security scanners often focus on preinstall and postinstall scripts in package.json, this method allows the malware to evade detection and gain execution on a developer's machine or in a CI/CD environment during a routine package installation.
The Miasma worm is a credential harvester with a broad target scope. Once executed via the binding.gyp file, it systematically searches for and exfiltrates sensitive information.
binding.gyp file contains a malicious entry that executes a script when npm install is run.kubeconfig)liuende501, which acts as a dead-drop location.This attack maps to several MITRE ATT&CK techniques:
T1195.002 - Compromise Software Dependencies and Development Tools: The core of the attack involves poisoning npm packages.T1059.007 - Command and Scripting Interpreter: JavaScript/Node.js: The malware executes within the Node.js environment.T1552 - Credentials from Password Stores: The malware actively searches for stored credentials for various services.T1048 - Exfiltration Over Alternative Protocol: Using GitHub as a dead-drop for exfiltrated data.The impact of the Miasma worm is critical and far-reaching:
liuende501Security teams may want to hunt for the following patterns to detect Miasma or similar attacks:
binding.gypnpm install spawning unexpected child processes or making network connections.github.com or other unexpected domains from CI/CD runners during a build process.package.json but also other build-related files like binding.gyp for suspicious commands or scripts.npm install commands for anomalous activity, such as unexpected file system access or network connections.npm install operations.package-lock.json, yarn.lock) to pin dependencies to specific, vetted versions. This prevents the automatic installation of newly published malicious versions.binding.gyp files.Running build processes in isolated, ephemeral environments can limit the blast radius of a compromised dependency.
Auditing build logs for anomalous behavior, such as unexpected network connections or file system access, can help detect this type of attack.
Using egress filtering to block outbound connections from CI/CD runners to non-essential destinations can prevent data exfiltration.
Implement dynamic analysis and sandboxing for all CI/CD build processes, specifically for the npm install step. This involves running the package installation in a controlled, instrumented environment that monitors for suspicious behavior like unexpected network calls, file system modifications outside the project directory, or execution of sensitive commands. By establishing a baseline of normal behavior for package installations, you can create alerts for any deviations, which would be indicative of a malicious package like Miasma. This can catch novel threats that signature-based scanners might miss.
Configure strict egress firewall rules for all developer workstations and CI/CD environments. By default, block all outbound traffic and only allow connections to known, trusted endpoints such as your company's official artifact repository, the official npm registry (registry.npmjs.org), and required source code repositories. This 'allowlist' approach would prevent the Miasma worm from successfully exfiltrating stolen credentials to an arbitrary GitHub account like liuende501, rendering the attack far less effective even if the initial execution succeeds.
Deploy EDR agents on developer workstations to monitor for suspicious processes and file access patterns. Specifically, configure rules to detect when a process spawned by npm or node attempts to access sensitive files like ~/.ssh/id_rsa, ~/.aws/credentials, or ~/.kube/config. The Miasma worm's primary goal is to harvest these files. Alerting on any access to these credential stores by a package manager or its child processes can provide an early warning of a compromise and allow for rapid response.
A variant of Miasma compromises 32 packages within the @redhat-cloud-services npm namespace.
A new wave of the Miasma worm compromises 57 npm packages across 286 malicious versions in 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.
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.