Critical Supply Chain Attack on npm’s binding.gyp Compromises Dozens of Packages
Key Takeaways A sophisticated self-replicating worm, dubbed “Phantom Gyp,” exploited a novel supply chain attack vector in the npm registry. The attack leveraged the binding.gyp...
Key Takeaways
- A sophisticated self-replicating worm, dubbed “Phantom Gyp,” exploited a novel supply chain attack vector in the npm registry.
- The attack leveraged the
binding.gypconfiguration file to bypass standard security checks, compromising 57 npm packages across over 286 malicious versions on June 3, 2026. - The malware, a variant of the Miasma worm, steals credentials from CI/CD environments (AWS, GCP, Azure, GitHub Actions, 1Password) and propagates itself by injecting malicious code into other packages.
- The threat actor also backdoored popular AI coding assistants (Claude Code, Cursor, Gemini) and left taunting messages referencing previous research.
Phantom Gyp: A New npm Supply Chain Threat Emerges
A stealthy, self-replicating worm has infiltrated the npm registry, employing an unconventional attack vector that circumvents many conventional security monitoring tools. Rather than embedding malicious scripts within typical package.json files, the attacker weaponized the diminutive binding.gyp configuration file. This innovative approach enabled the malicious code to execute immediately upon a developer issuing the npm install command.
Table Of Content
This rapid and efficient supply chain attack unfolded across numerous maintainer accounts, affecting dozens of packages in a concentrated wave lasting less than two hours. The full extent of this campaign has been detailed in a report by researchers at StepSecurity, who have named this technique “Phantom Gyp.”
Attack Details and Impact
On June 3, 2026, the attack compromised 57 npm packages across more than 286 malicious versions. The initial target, struck at 23:30 UTC, was @vapi-ai/server-sdk, the official Vapi.ai voice AI server SDK, which boasts over 408,000 monthly downloads. Within an hour, the campaign expanded to include more than 50 additional packages maintained by ‘jagreehal’, including ai-sdk-ollama, with over 120,000 monthly downloads.
The StepSecurity analysis, shared with Cyber Security News (CSN), highlights how the attacker exploited a mere 157-byte binding.gyp file. This file triggered code execution during installation, effectively bypassing the preinstall and postinstall lifecycle checks that most security scanners are designed to detect. This method works because npm automatically invokes node-gyp rebuild when a binding.gyp file is present, interpreting it as an indication that the package contains native C or C++ code.
The attacker cleverly embedded a shell command using gyp’s native command substitution syntax. This silently launched a malicious payload while presenting a falsified source filename, ensuring the build process appeared error-free. Consequently, security tools focused solely on package.json for install scripts would detect no anomalies.

A significant indicator of compromise was the size discrepancy: the malicious root index.js file measured 4.5 MB, vastly larger than the legitimate package entry point of only 27 KB. The payload itself was highly obfuscated, employing four layers of defense including a ROT cipher, AES-128-GCM encryption, and a runtime-switching technique. This technique involved downloading the Bun JavaScript runtime in under one second to execute the final stage outside of Node.js, specifically designed to evade security tools monitoring only Node.js process activity.
Miasma Worm Variant and Attacker Motives
The deployed payload is a new variant of the Miasma worm, a self-propagating supply chain malware family. This particular variant had previously targeted 32 packages under the @redhat-cloud-services npm namespace just two days prior to the current attack. The attacker demonstrated a clear awareness of security research, leaving a taunting message in 195 GitHub repository descriptions: a reversed string that decodes to “Shai-Hulud: Here We Go Again.” This directly references StepSecurity’s earlier analysis of the Red Hat compromise, indicating a calculated and persistent threat actor.
Credential Theft, Worm Propagation, and AI Backdoors
Once activated, the malware functions as a sophisticated credential harvester, specifically tailored for CI/CD environments. It targets critical credentials such as AWS keys, GCP credentials, Azure tokens, HashiCorp Vault tokens, GitHub Actions secrets, and 1Password vaults. Notably, it scrapes GitHub Actions runner memory to extract masked secrets in their unmasked form, a technique previously observed in the May 2026 TanStack compromise. Stolen credentials are then encrypted and uploaded to programmatically created repositories under the attacker-controlled GitHub account liuende501.

The worm’s capabilities extend beyond credential theft. It leverages stolen npm tokens to enumerate all packages owned by a compromised maintainer, injects the binding.gyp payload into each, and then republishes them with forged SLSA provenance and Sigstore signing. This makes reinfected packages appear legitimate, even to tools designed to verify supply chain integrity.
Furthermore, the malware injects backdoor configuration files into popular AI coding assistants, including Claude Code, Cursor, and Gemini. This allows the attacker to subtly influence AI-assisted suggestions within poisoned projects, potentially introducing further malicious code or vulnerabilities.
What You Should Do
- Immediate Credential Rotation: Treat all credentials from compromised environments as stolen and rotate them without delay.
- Repository Audit: Conduct a thorough audit of all repositories and CI pipelines for any affected packages.
- Check for AI Assistant Backdoors: Look for injected AI assistant files in your project repositories, specifically
.claude/setup.mjs,.cursor/rules/setup.mdc, and.vscode/setup.mjs. - Network Blocking: Implement immediate containment by blocking outbound network access to
github.com/liuende501and the Bun download endpoint (https://github.com/oven-sh/bun/releases/download/bun-v1.3.13/bun-linux-x64-baseline.zip). - Enhanced Scanning: Review and update security scanning tools to detect anomalies in configuration files like
binding.gyp, not justpackage.json. - Monitor for IoCs: Actively monitor your environment for the following Indicators of Compromise:
Indicators of Compromise (IoCs)
| Type | Indicator | Description |
|---|---|---|
| GitHub Account | github[.]com/liuende501 | Attacker-controlled exfiltration account hosting 236 programmatically created repositories |
| URL | https://github[.]com/oven-sh/bun/releases/download/bun-v1.3.13/bun-linux-x64-baseline.zip | Bun runtime download URL used during payload execution |
| C2 Keyword | thebeautifulmarchoftime | GitHub commit search keyword used as C2 beacon to verify channel is active |
| C2 Keyword | IfYouInvalidateThisTokenItWillNukeTheComputer | GitHub commit search keyword used to validate stolen token is not revoked |
| Fake User-Agent | python-requests/2.31.0 | User-Agent string used by malware despite running inside Bun runtime |
| Exfil Path Pattern | repos/liuende501/{repo}/contents/results/results-{timestamp}.json | Pattern used to store encrypted stolen credentials in exfiltration repos |
| File Hash (SHA256) | 288f26c2eadcb1a7923fe376d16f5404216cc… | Package tarball (.tgz) from [email protected] |
| File Hash (SHA256) | ef641e956f91d501b748085996303c96a64d6… | binding.gyp (157 bytes) — identical across all compromised versions |
| File Hash (SHA256) | 5926b86b642e00672252953eb30d8f75cfb77… | Obfuscated root index.js (4.5 MB) from [email protected] |
| File Hash (SHA256) | ceff7c51d70832c3ec8dd2744b606a23b3c92… | Decrypted Bun loader blob (907 bytes) |
| File Hash (SHA256) | da39146ef451d1b174a24d00b1e2a45cd38d5… | Decrypted main payload (668 KB) |
| File Hash (SHA256) | e3dbe63aded45278f49c4746ab938ed9472b3… | index.js from @vapi-ai/server-sdk v1.2.1 (4,870,718 bytes) |
| File Hash (SHA256) | 82d83274680df928fdda296a348e01802f595… | index.js from @vapi-ai/server-sdk v0.11.2 (4,496,586 bytes) |
| Malicious File | binding.gyp | 157-byte install hook containing the Phantom Gyp command substitution trigger |
| Malicious File | index.js (root, 4.5 MB+) | Obfuscated malware payload placed at package root, not declared as package main |
| Temp Path Pattern | /tmp/b-{random}/ | Temporary directory used to stage and execute downloaded Bun runtime |
| Temp File Pattern | /tmp/p{random}.js | Randomized temp path used to write and execute the final malware payload |
| Malicious File | .claude/setup.mjs | AI assistant backdoor file injected into victim repositories (Claude Code) |
| Malicious File | .cursor/rules/setup.mdc | AI assistant backdoor file injected into victim repositories (Cursor AI) |
| Malicious File | .gemini/settings.json | AI assistant backdoor file injected into victim repositories (Google Gemini) |
| Malicious File | .vscode/setup.mjs | AI assistant backdoor file injected into victim repositories (VS Code) |
| API Endpoint | https://registry[.]npmjs.org/-/whoami | Used by worm to validate stolen npm tokens before propagation |
| API Endpoint | http://169[.]254[.]169[.]254/latest/api/token | AWS IMDSv2 endpoint targeted for cloud credential harvesting |
| API Endpoint | http://169[.]254[.]169[.]254/metadata/identity | Azure IMDS endpoint targeted for cloud credential harvesting |
| Repo Description | Miasma – The Spreading Blight | Self-identifier found in 34 exfiltration repository descriptions |
| Repo Description | niagA oG eW ereH :duluH-iahS | Reversed string (“Shai-Hulud: Here We Go Again”) found in 195 exfil repo descriptions |
Disclaimer: HackersRadar reports on cybersecurity threats and incidents for informational and awareness purposes only. We do not engage in hacking activities, data exfiltration, or the hosting or distribution of stolen or leaked information. All content is based on publicly available sources.



No Comment! Be the first one.