Back to Insights
Vulnerabilities4 min read2 June 2026

Miasma Supply Chain Attack Plants Credential-Stealing Worm Inside Red Hat npm Packages

A sophisticated campaign named Miasma has weaponized npm packages tied to the Red Hat ecosystem, silently harvesting developer credentials and burrowing into CI/CD pipelines the moment a compromised package lands on disk.

EF
Elena FischerThreat Intelligence Analyst
Photoreal editorial scene: a developer's dimly lit workstation at night, multiple monitors showing terminal windows with

A newly identified supply chain campaign called Miasma has embedded malicious code inside npm packages associated with the Red Hat ecosystem, executing a credential-stealing worm on installation and spreading laterally through CI/CD infrastructure.

What Happened — and Why It Matters

Miasma does not exploit a vulnerability in Red Hat's cloud services directly. Instead, attackers poisoned packages that carry the trust of a well-known brand. The distinction matters. Developers see a familiar namespace, trust the lineage, run `npm install`, and the payload fires instantly — no user interaction required beyond that single command.

The attack shares a tactical fingerprint with a prior campaign researchers call Mini Shai-Hulud. Both campaigns rely on four linked techniques: install-time code execution, credential harvesting, CI/CD pipeline injection, and encrypted exfiltration of stolen data. That consistency suggests either the same threat actor or a copycat who studied the earlier operation closely and replicated its playbook.

As of publication, Red Hat had not publicly identified the specific package names affected. The company urged developers to audit recent installations and watch for anomalous network traffic, particularly outbound connections carrying encrypted payloads to unexpected destinations.

How the Worm Spreads

The self-propagation capability is what elevates Miasma above a run-of-the-mill info-stealer. Once installed, the payload scans the compromised developer environment for CI/CD configuration files — think `.github/workflows`, `Jenkinsfile`, or `.gitlab-ci.yml`. It injects itself into those pipelines, meaning every downstream build that pulls dependencies from the infected environment becomes a potential new host.

This is a force-multiplier. One careless `npm install` on a lead engineer's workstation can propagate the worm into production build systems, container registries, and artifact repositories within hours. The blast radius grows geometrically.

The Verizon 2024 Data Breach Investigations Report found that software supply chain attacks featured in 15 percent of breaches involving a third party — a figure that has climbed steadily as adversaries recognize the asymmetric return on compromising shared dependencies rather than individual targets. Miasma fits that trend precisely.

Which Controls Failed

The root failure here is misplaced trust in package provenance. npm's install lifecycle hooks — `preinstall`, `install`, `postinstall` — are legitimate features that attackers routinely abuse. There is no built-in warning when a newly published or updated package adds a lifecycle script that did not previously exist. Developers rarely diff a package's `package.json` between versions before running install.

Identity hygiene inside CI/CD systems compounds the problem. Pipelines often run with broad environment-variable access, meaning a compromised step can read `AWS_SECRET_ACCESS_KEY`, `GITHUB_TOKEN`, or deployment credentials stored as pipeline secrets. Those are exactly the high-value targets Miasma harvests. The principle of least privilege — granting pipeline steps only the permissions they need to complete their specific task — is frequently ignored in favor of convenience.

Software composition analysis (SCA) tools and dependency-integrity checks using lock files and cryptographic signatures exist precisely to catch these scenarios, but adoption remains inconsistent. NIST's Secure Software Development Framework (SP 800-218) explicitly recommends verifying the integrity of all third-party components before use. Many development teams acknowledge the guidance without operationalizing it.

What Defenders Should Do Right Now

Security engineers across organizations using npm packages tied to the Red Hat namespace should treat the following steps as urgent, not aspirational.

Audit installed packages immediately. Run `npm audit` and cross-reference your `package-lock.json` against known-good checksums. Look for packages installed or updated in the last 30 days that you did not explicitly request.

Restrict lifecycle script execution. Configure npm with `--ignore-scripts` for automated installs where lifecycle hooks are not needed. This single flag eliminates the install-time execution vector Miasma relies on.

Monitor outbound encrypted traffic from build systems. Unexpected TLS connections to unfamiliar endpoints during a build job are a red flag. Set up egress filtering and alert on anomalies.

Scope CI/CD secrets tightly. Each pipeline stage should have access only to the credentials it needs. Rotate any secrets that may have been exposed in pipelines running affected packages.

Enable Sigstore or similar package signing. The npm ecosystem now supports provenance attestations. Require signed packages in your internal registries and reject anything that cannot produce a verifiable attestation.

Review your developer endpoint monitoring. Miasma runs on the developer's machine first. Endpoint detection that can surface unexpected process spawning during `npm install` will catch this class of attack before it reaches your pipelines.

The Human Layer

Technical controls catch what humans miss at scale — but humans define what controls get implemented. Developer teams routinely install packages with minimal scrutiny because the pace of modern software delivery punishes slowdowns. That cultural pressure is an attack surface.

Organizations that run security-awareness training tailored to engineering teams — covering supply chain hygiene, safe dependency management, and recognizing anomalous build behavior — close a gap that no firewall addresses. A developer who pauses to question an unexpected lifecycle script is a control that costs almost nothing to deploy.

The Miasma campaign is not the last of its kind. Mini Shai-Hulud came first; Miasma refined the technique. The next iteration will be more targeted, more evasive, and aimed at a namespace developers trust even more. Organizations that align their developer training programs with frameworks like those catalogued at Train2Secure Standards put themselves ahead of that curve rather than behind it.

What Red Hat Users Should Watch

Red Hat has not confirmed a comprehensive package list, so defenders cannot rely on a blocklist. The safer posture is to assume any package in your environment could be affected and verify proactively. Check whether your internal package mirror pulled any updates in the relevant window. Validate that your CI/CD pipelines did not execute unexpected scripts during recent builds. And if you find evidence of compromise, preserve logs before remediating — forensic data is the only way to understand the true blast radius.

How your team can stop the next Miasma before install

  • Train developers to scrutinize lifecycle scripts and verify package provenance before every install — not just after an incident.
  • Implement least-privilege CI/CD secret scoping and automated dependency-integrity checks aligned with NIST SP 800-218.
  • Run tabletop exercises simulating a poisoned-dependency scenario so your security and engineering teams know exactly how to respond.

Train2Secure offers developer-focused security-awareness courses that turn supply chain hygiene from policy language into daily habit.

Start free — no card required

Frequently asked questions

Were Red Hat's cloud services directly breached by the Miasma attack?

No. Miasma targeted npm packages associated with the Red Hat ecosystem, not Red Hat's own cloud infrastructure. The attack exploits developer trust in recognizable package namespaces rather than a flaw in Red Hat's hosted services.

How does Miasma spread beyond the initial infected machine?

After executing at install time, the worm locates CI/CD configuration files on the developer's system and injects itself into pipeline definitions. Subsequent builds pull and execute the malicious code, propagating the infection to build servers, artifact registries, and downstream environments.

What is the fastest mitigation developers can apply right now?

Run npm installs with the `--ignore-scripts` flag to block install-time code execution, audit your lock file for unexpected changes in the past 30 days, and rotate any CI/CD secrets that pipelines running these packages could have accessed.

Does using a private or internal npm registry protect against this attack?

A private registry reduces exposure if it is configured to proxy only vetted packages and enforce integrity checks. However, if the registry mirrored the compromised packages before the attack was identified, the risk remains. Pair private registry use with SCA tooling and cryptographic attestation for stronger protection.

Ready to Reduce Your Human Cyber Risk?

Sign up and start training your team in minutes. No sales calls, no demos — just pick a plan and go. Phishing simulations, video courses, and certificates from day one.

train2secure analytics dashboard showing training completion stats and user progress