TL;DR: A self-spreading npm worm compromised 57 packages across 286+ malicious versions by abusing binding.gyp during install, then stealing AWS, GCP, Azure, GitHub Actions, and password-store secrets while planting AI coding-assistant backdoors, according to Semgrep. The pattern shows how software supply chain abuse now blends secrets theft, CI/CD compromise, and AI-assisted persistence into one propagation path.
NHIMG editorial — based on content published by Semgrep: the Miasma npm worm and its secret-theft and persistence techniques
By the numbers:
- A self-spreading npm worm dubbed Miasma compromised 57 npm packages across 286+ malicious versions.
Questions worth separating out
Q: What breaks when npm package installs are allowed to execute code before inspection?
A: The control point disappears.
Q: Why do exposed secrets in CI/CD pipelines create such a large blast radius?
A: CI/CD systems often hold cloud credentials, deployment tokens, and repository access in the same execution context.
Q: What do teams get wrong about securing AI coding assistants?
A: Teams often focus on code output and ignore the agent boundary, where file reads, tool outputs, and external content shape the next action.
Practitioner guidance
- Lock down install-time execution paths Block or review build-file actions such as binding.gyp and other native build hooks in dependency pipelines, especially where package provenance is weak or unverified.
- Remove long-lived credentials from runners Use short-lived, task-scoped credentials for CI/CD and avoid placing cloud keys, GitHub Actions secrets, or password-store material on systems that execute third-party installs.
- Scan developer AI tooling for persistence artefacts Check .claude, Cursor, Gemini, and VSCode configuration files for unauthorised changes, injected setup scripts, and rules that can influence generated code.
What's in the full analysis
Semgrep's full analysis covers the operational detail this post intentionally leaves for the source:
- Package-by-package exposure mapping for the affected npm ecosystem and the versions that were touched
- Indicators of compromise for CI/CD, developer workstations, and repository exfiltration paths
- File and system artefacts linked to AI assistant persistence across Claude, Cursor, Gemini, and VSCode
- Recommended investigative steps for identifying compromised pipelines and rotating credentials after exposure
👉 Read Semgrep's analysis of the Miasma npm worm and secret theft chain →
Miasma npm worm: what it means for CI/CD, secrets, and AI code tools?
Explore further
Software supply chain compromise is now an identity problem as much as a code problem. Miasma does not need to break encryption or exploit a zero-day in the classic sense. It abuses the trust relationship between package install processes and the credentials available to those processes. That means build systems, developer laptops, and CI runners have become identity-bearing environments that must be governed like privileged infrastructure. Practitioners should treat package provenance and secret exposure as one control plane, not two.
A few things that frame the scale:
- DeepSeek accidentally embedded over 11,000 secrets in its training data and left a database exposed online, revealing more than one million sensitive records including chat histories, backend credentials, and API keys, according to LLMjacking: How Attackers Hijack AI Using Compromised NHIs.
- When AWS credentials are exposed publicly, attackers attempt access within an average of 17 minutes, and as quickly as 9 minutes in some cases, according to LLMjacking: How Attackers Hijack AI Using Compromised NHIs.
A question worth separating out:
A: Containment should start with credential rotation, runner isolation, and repository forensics across any affected build or test systems. Teams should also inspect workstation and assistant configuration artefacts, because persistence may survive package removal. Finally, treat all package installs from the affected window as untrusted until validated.
👉 Read our full editorial: Miasma npm worm shows how package install becomes a secret-theft channel