Skip to main content

Miasma: How a Compromised Red Hat GitHub Account Published Malware Through npm Trusted Publishing

· 8 min read
Ankush K
Co-founder and CTO, Dwaar
Miasma: How a Compromised Red Hat GitHub Account Published Malware Through npm Trusted Publishing

If your builds pulled a @redhat-cloud-services package since late May, you have a harder question than which version to bump. There is no fixed version, no CVE for a scanner to match, and the malware reportedly signs its tarball through Sigstore. You need to find out whether the code ran, and what it could reach.

At a glance
IdentifierNo CVE. Red Hat bulletin RHSB-2026-006
Affected32 packages and 96 versions in the @redhat-cloud-services npm scope, per researchers cited by BleepingComputer
Fixed inNo fixed version published. Red Hat removed the compromised versions from npm
SeverityNo CVE, so no NVD score
Exploited as of 2026-06-04Yes, malicious versions reached the public registry. No CVE means no KEV entry. Red Hat reports no customer or partner impact identified so far
Disclosed2026-06-01

Weekly downloads differ by source: about 117,000 in BleepingComputer, over 115,000 in iTnews.

How it got published​

Red Hat's bulletin, created June 1 and unchanged in a June 3 snapshot, gives the entry point in one line: "a compromised GitHub account was used to push unauthorized commits to repositories in the RedHatInsights GitHub organization." It does not say how the account was compromised. The Hacker News dates the first commit containing the string "Miasma: The Spreading Blight" to May 29.

These were orphan commits pushed directly, bypassing code review. They added a GitHub Actions workflow that installs Bun and runs _index.js, with target packages listed in the OIDC_PACKAGES environment variable. Using the id-token: write permission, the script requests a short-lived OIDC token from GitHub and publishes through npm trusted publishing. The Hacker News adds that the malware repackages a tarball as package-updated.tgz and signs it via Sigstore.

The sources disagree on wording. iTnews says the attack got around trusted publishing, while BleepingComputer describes the script authenticating to npm's trusted publishing endpoint. The Hacker News mentions only that the payload calls OIDC token exchange endpoints. I side with BleepingComputer's reading: the publish came through the project's own path, started by a workflow the attacker added.

What runs on install​

The published packages carry a preinstall hook that runs node index.js, an obfuscated payload of about 4.2 MB. BleepingComputer lists what it steals: GitHub Actions secrets, AWS, GCP and Azure credentials, Vault and Kubernetes service account tokens, npm and PyPI tokens, SSH and GPG keys, Docker credentials and .env files.

The Hacker News, relaying researcher analysis, describes the rest:

  • Spread. It enumerates writable repositories and commits a workflow with createCommitOnBranch, so the commit looks verified.
  • Privilege. A container bind-mounts the host's /etc/sudoers.d, giving the CI runner passwordless sudo.
  • Exfiltration. Stolen credentials go to public GitHub repositories carrying the description "Miasma: The Spreading Blight". Microsoft also describes a POST path to api.anthropic.com:443/v1/api that is disabled in the sample it analysed (noop: true), and says the same domain is used to validate stolen Anthropic keys. The Hacker News lists that domain as the destination with GitHub as a fallback, but Microsoft's analysis is the more detailed.
  • Persistence. It writes a SessionStart hook into Claude Code's ~/.claude/settings.json and a .vscode/tasks.json with runOn set to folderOpen.

BleepingComputer counted 309 GitHub repositories compromised by the campaign at the time of writing and calls attribution unclear: possibly TeamPCP, possibly another actor reusing leaked source.

Red Hat's statements do not fully line up​

Red Hat told reporters (BleepingComputer on June 1, iTnews on June 2) the packages are "strictly limited to internal development". Its bulletin, also dated June 1, calls them "frontend libraries that are compiled and bundled into some container images during the Red Hat product build process", with build analysis still under way, and adds: "Based on current findings, no actions from customers are required."

I read that as being about Red Hat's products. It does not clear a machine of yours that installed from this scope.

What to check and do now​

Red Hat, BleepingComputer and The Hacker News publish no version list, but Microsoft's analysis has a table of malicious versions per package, for example rbac-client 9.0.3, 9.0.4 and 9.0.6. Check your lockfiles against that table, and also search on the scope, because Microsoft counts "more than 90" versions and researchers count 96. The Hacker News names rbac-client, sources-client and remediations-client among others. Researchers cited by iTnews tell anyone who installed from the scope since June 1 to treat CI secrets, cloud credentials, SSH keys and npm tokens as compromised. I would start the window at May 29, the earliest commit date reported.

  1. Find exposure. Search lockfiles, internal registry caches and CI logs for the scope, including developer tooling.
  2. Isolate before you rotate. One reported commit message pattern is IfYouInvalidateThisTokenItWillNukeTheComputerOfTheOwner:<token>. Take the host off the network, then rotate everything it could reach from a clean machine.
  3. Do not stop at removal. As The Hacker News reports, "uninstalling the npm package or deleting node_modules should not be considered sufficient cleanup."
  4. Distrust what the host built. Suspend affected CI runs, invalidate artifacts from the window, and review releases, images and deployments created after the install.
  5. Hunt the indicators. Look for _index.js with OIDC_PACKAGES, package-updated.tgz, .github/workflows/codeql.yml, .github/setup.js, the persistence files above, and public repositories carrying "Miasma: The Spreading Blight".

The wider lesson: the manifest is not the whole package​

The reflex answer to a preinstall worm is to turn off lifecycle scripts. Keep doing that where your builds allow it. npm documents ignore-scripts as: "If true, npm does not run scripts specified in package.json files." That covers a declared hook.

Now read npm's scripts documentation. With a binding.gyp in the package root and no install or preinstall script defined, "npm will default the install command to compile using node-gyp via node-gyp rebuild". A package can run a build at install while its package.json declares nothing, and a policy keyed on hook names in that file has nothing to flag.

None of the reporting cited here ties that path to Miasma, which used a declared preinstall hook. I raise it as a general gap. The two npm sources above, both at the v11.6.0 tag, do not say whether ignore-scripts also stops the default node-gyp rebuild, so test it on your npm version before you rely on it.

My position: ask questions of the tarball, because that is what runs. That is the argument for scanning the artifact you ship. Provenance, where a package has it, has the same limit: it tells you which pipeline built a package, not who last edited that pipeline.

Start with one service today. List the dependencies whose tarballs contain a binding.gyp, and ask of each why it compiles. Then list every repository where a workflow holds id-token: write, and who can push to it.

References​