The Red Hat npm Supply-Chain Attack: What Actually Happened, and What to Do About It
On June 1, 2026, Wiz Research flagged that the @redhat-cloud-services npm namespace had been compromised. At least 32 package releases under that trusted, official scope were quietly republished with a malicious install-time payload. The affected packages pull roughly 80,000 downloads a week between them, so this is not a typo-squat on a package nobody installs — it's a hijack of a name developers already trust and pin in their lockfiles.
Researchers named the payload Miasma, a new strain in the Shai-Hulud family of npm worms that has been chewing through the registry all year. I build small developer tools and run coding agents that npm install all day long, so a credential-stealer that fires during installation is exactly the failure mode that keeps me reading these postmortems instead of skimming them. Here's the honest breakdown.
What actually happened
The attackers didn't guess a password. According to Wiz, they got into a Red Hat employee's GitHub account and used it to inject malware through the project's GitHub Actions workflows. Those workflows had id-token: write permission, which let the pipeline request a short-lived OIDC token and publish to npm as the legitimate owner. The publish came from the real CI system, with the real identity. No leaked npm token required.
The malicious versions shipped a heavily obfuscated _index.js that ran at install time via a preinstall script. The moment you ran npm install on a project that pulled a poisoned version, the payload executed on your machine or in your build — before any of your own code ran.
What it steals
Miasma is a broad credential sweep, and the target list reads like an inventory of everything a developer machine touches:
- GitHub tokens and SSH private keys
- Cloud credentials — AWS access keys, GCP and Azure identity tokens, and "all identities the infected machine has access to"
- CI/CD secrets and environment variables
- npm and PyPI publish tokens (which is how the worm keeps spreading)
- Docker credentials, GPG keys, Kubernetes tokens, and HashiCorp Vault tokens
It doesn't propagate over the network like a classic worm. It spreads the way the registry itself spreads: it harvests the publish tokens it finds, uses them to poison more packages, and waits for the next developer's install to do the work. Every compromised CI pipeline becomes a new launch point.
The part you should actually be scared of
Here's the detail that I think matters more than the credential list: the malicious releases carried valid SLSA provenance attestations.
Provenance is the thing we've all been told to trust. It's the cryptographic receipt that says "this package was built by this pipeline from this commit." It is genuinely good security infrastructure. But provenance proves a build happened in a given pipeline — it does not prove the pipeline wasn't owned. When the attacker is publishing through the legitimate CI identity, the attestation is real, the signature checks out, and "verify provenance" waves it straight through.
So the lesson isn't "provenance is useless." It's narrower and more uncomfortable: provenance moves the trust boundary to your CI/CD identity, and most teams have spent far less effort securing a GitHub Actions OIDC configuration than they have securing a production database. The npm registry was never the soft spot. The soft spot was a single developer's GitHub account and a workflow with token-minting permission.
What to do about it
For this specific incident, the affected versions had largely been revoked by the time it went public, and Red Hat has stated that none of the compromised package versions were used in any shipped Red Hat product. But "the bad versions are gone" is not the same as "your machine is clean." If you installed anything from @redhat-cloud-services in the last few days — especially in CI — treat it as exposed and rotate:
- Rotate everything the build environment could see. npm tokens, cloud keys, GitHub PATs, SSH keys, anything in CI secrets. The payload's whole job was to read them; assume it did.
- Audit your GitHub Actions and recent npm publishes for anything you didn't trigger. The breach started with one account, not a registry-wide flaw.
- Pin and review. A committed lockfile with integrity hashes means a silently republished version doesn't slip in on the next install. Hash-based detection of the payload is useless here — each infection is uniquely encrypted — but a pinned hash of the version you vetted still protects you.
- Disable install scripts where you can.
npm install --ignore-scripts(or theignore-scriptssetting) neutralizes the entire install-time-execution class of attack. It breaks some legitimate native builds, so it's a per-project call, but for most application repos it's free safety. - Treat CI/CD identity as a crown jewel. Scope
id-token: writeas tightly as the workflows that genuinely publish, require review on workflow changes, and prefer trusted-publishing setups that bind a token to a specific repo and environment.
The bigger pattern
This is the third or fourth npm namespace this year to fall the same way — axios, TanStack, and now Red Hat's cloud-services scope all got hit through a compromised maintainer identity rather than a flaw in npm. The registry keeps doing its job. The accounts that publish to it keep being the weak link.
The takeaway I keep landing on: supply-chain security in 2026 is identity security wearing a different hat. Your dependency graph is exactly as trustworthy as the least-protected GitHub account with publish rights to anything you install. Provenance, lockfiles, and SBOMs are all worth having — but they're guardrails around a trust decision, not a replacement for it. The teams that came through this fine are the ones who'd already decided their CI tokens were as sensitive as their production database password, because in an attack like this, they are.
Sources
- Wiz Research — Miasma: Supply Chain Attack Targeting Red Hat npm Packages
- Aikido Security — Red Hat npm Packages Compromised to Spread a Credential-Stealing Worm
- Red Hat Customer Portal — Multiple supply chain compromises of open source projects (RHSB-2026-001)