by datastudy.nl

Friday, June 5, 2026

LiveEngineering

Miasma worm: live coverage of the Red Hat npm attack

Miasma is a self-propagating npm worm. It hijacked Red Hat's GitHub Actions OIDC trusted publishing to ship 96 backdoored @redhat-cloud-services versions whose preinstall hook runs a Bun credential stealer that then spreads with the secrets it steals.

All times UTC. Newest update first.

Red Hat is one of the most security-conscious vendors in open source, and last week its npm packages spent a Monday quietly handing developer credentials to an attacker. The campaign is called Miasma, and as of Friday morning it is still spreading. This page tracks it from the bottom up, oldest entry first if you scroll down, newest at the top.

Here is the short version for anyone landing cold. On June 1 an attacker hijacked Red Hat's automated npm publishing and shipped 96 backdoored versions of 32 @redhat-cloud-services packages, a set with close to 10 million downloads. Each poisoned package runs a hidden script the instant you install it, which downloads a credential stealer that scrapes your cloud keys, CI tokens, and SSH keys, then uses what it steals to attack the next project. By Friday the same worm has spread to at least 309 GitHub repositories and has started planting itself in editor and AI-agent config so it fires when you merely open a cloned repo.

The name comes from the malware itself: every dead-drop repo full of stolen secrets is tagged Miasma: The Spreading Blight. It is a variant of the Mini Shai-Hulud worm, whose source code the group TeamPCP open-sourced in May, which is why definitive attribution is still out of reach.

If you or your CI installed any affected version, treat the host as compromised: isolate it, rotate every credential it could reach, and do not assume npm uninstall cleaned it. The timeline below carries the detail, with each claim linked to the primary research from Aikido, OX Security, SafeDep, ReversingLabs, StepSecurity, JFrog, Socket, Wiz, WhiteIntel, BleepingComputer, and The Hacker News.

  1. Latestconfirmed

    Confirmed: the worm wipes your disk if you revoke the token

    The dead man's switch is real. Pull the stolen npm token and the payload runs a destructive command. We confirmed it, with one correction to the scary version of the story going around.

    Read the full update Show less

    A reader asked whether the rumour about a rm -rf dead man's switch is true. It is, and it has been independently documented by several research teams. Here is the precise version, because the details matter when you are deciding how to respond to an infection.

    The Shai-Hulud payload installs a background daemon that polls the GitHub and npm APIs to check whether its stolen token is still valid. The moment that token gets revoked and the daemon sees an HTTP 40x response, Snyk found that it runs rm -rf ~/, wiping the victim's entire home directory. JFrog, The Hacker News, and GitLab all describe the same revocation-triggered destructive routine. So the instinct to immediately yank the compromised token is exactly what arms the trap.

    Now the correction. The version circulating online says the worm runs rm -rf / to wipe the whole machine. The default npm payload targets your home directory, not root. The full-disk rm -rf / is a separate, geofenced routine that the Cloud Security Alliance documented in the PyPI variants: on systems whose locale indicates Israel or Iran, there is a one-in-six chance the payload runs rm -rf / instead. That is a deliberate, targeted escalation, not the everyday behaviour.

    The practical takeaway for anyone hit: do not revoke the token on the infected box and keep working. Isolate the machine from the network first, then rotate credentials from a clean device, npm tokens first, then GitHub PATs, then cloud keys. The destructive trigger only bites if the daemon is still alive to see the revocation.

  2. background

    Wait, what is a Shai-Hulud and what is Miasma?

    Quick glossary, because the names are doing a lot of work. Shai-Hulud is the family of self-spreading npm worms; Miasma is the specific June 2026 strain that hit Red Hat. One is the species, the other is the individual.

    Read the full update Show less

    The names are borrowed and a little dramatic, so here is the plain version.

    Shai-Hulud is the name of the worm family, not a single attack. The phrase is lifted from Frank Herbert's Dune, where it is the giant sandworm, and the attackers chose it themselves: the original September 2025 payload literally created a malicious GitHub repo called "Shai-Hulud" on every machine it infected. What makes something a Shai-Hulud worm is the self-replication. It does not just steal secrets; it uses the npm publish tokens it steals to poison the next maintainer's packages automatically, so the infection jumps from package to package without a human pushing it along. That is why people call it a worm rather than just malware. Seven separate Shai-Hulud campaigns have run in roughly ten months, escalating from a few hundred repos to the 26,000-repo "Second Coming" in November 2025.

    Miasma is the specific strain we are covering on this page, the one that hit Red Hat in early June 2026. Think of Shai-Hulud as the species and Miasma as the individual animal. What sets Miasma apart from earlier Shai-Hulud waves is how it got in: instead of phishing a maintainer's token, it hijacked Red Hat's GitHub Actions OIDC trusted publishing, the keyless mechanism that is supposed to be the safer way to publish, and used it to ship 96 backdoored @redhat-cloud-services versions in seventy-two seconds. Each one carries a preinstall hook that runs a Bun-based credential stealer, which then spreads using whatever it grabs. Same worm bloodline, nastier entry point.

    If you want the people behind it rather than the code, that is TeamPCP, and we go deep on them in the threat-actor piece.

  3. analysis

    North Korea is running the same play, separately

    A parallel npm campaign by the DPRK-linked FAMOUS CHOLLIMA crew shows the bigger pattern: the technique, not the actor, is what spread. It is a different group from TeamPCP, using a different delivery trick, chasing the same goal.

    Read the full update Show less

    A reader pointed us at reporting that ties Miasma to North Korea. The link is real, but it is not what the headline suggests, and the distinction matters.

    There is a second, unrelated crew hitting npm right now. On June 3, Microsoft Threat Intelligence flagged two malicious packages, [email protected] and [email protected], that deploy a remote access trojan and exfiltrate stolen keystrokes, wallets, and cloud credentials through Hugging Face's own dataset API, so the traffic looks like ordinary machine-learning activity. OX Security and Socket attribute that cluster, nicknamed MicrosoftSystem64, to FAMOUS CHOLLIMA, the DPRK-linked group also tracked as Contagious Interview that lures developers with fake job interviews. It has been rotating npm accounts since at least April, from js-logger-pack through the current toskypi and hexalpha10 identities, all pointing at the same C2 at 195.201.194[.]107.

    So is North Korea behind Miasma? No. FAMOUS CHOLLIMA and TeamPCP are different actors using different delivery: the DPRK crew leans on postinstall hooks and Hugging Face as a dead drop, while Miasma hijacks Red Hat's OIDC trusted publishing. What connects them is the technique, abusing infrastructure you already trust, and that is exactly why TeamPCP open-sourcing the Shai-Hulud playbook is the real story. A method that used to take a state-grade team is now a public template, and the campaigns are arriving in parallel from crews that have never met. The through-line is not the flag on the operator. It is the trust model the whole ecosystem still runs on. We unpack that in our piece on the crew behind the worm.

  4. analysis

    Who is actually behind this

    We dug into the crew shipping Miasma. It is TeamPCP, the cybercrime group that open-sourced the Shai-Hulud worm in May and ran a paid contest to get others to use it.

    Read the full update Show less

    Miasma is not a one-off. It is the latest move by TeamPCP, the financially motivated cybercrime crew tracked by Unit 42 as TGR-CRI-1135 and by Mandiant as UNC6780. The group has run at least seven Shai-Hulud supply chain campaigns in ten months, from the first self-replicating npm worm in September 2025 to the 26,000-repo "Second Coming" in November to the May 2026 TanStack cluster that scored a CVSS 9.6 and shipped malware carrying valid SLSA provenance.

    The turning point came on May 15, when TeamPCP published the worm's source code on GitHub and bankrolled a BreachForums contest paying criminals to use it. That hands everyone a built-in alibi: every new incident now arrives with the question of whether it was the original crew or a contest entrant. Our read is that Miasma's sophistication, the OIDC trusted-publishing hijack, the heavy obfuscation, the reused dead-drop pattern, points to TeamPCP or an operator indistinguishable from it. Either way, the lesson is that attribution stopped being the useful question.

    We pulled the full picture together in a separate piece on who TeamPCP is and how the lineage escalated.

  5. analysis

    The worm jumps from npm to your editor

    Miasma's newest wave skips the registry entirely. It plants auto-run config in GitHub repos so the payload fires the moment you open the project in VS Code, Cursor, Claude Code, or Gemini.

    Read the full update Show less

    The latest mutation, documented by SafeDep this morning, drops the npm package step altogether and targets developer tooling directly. A commit titled chore: update dependencies [skip ci] landed in icflorescu/mantine-datatable and four sibling repositories inside a 49 second window, adding six files that carry 1,459 GitHub stars between them.

    Five of the six files exist only to launch the sixth. The payload is .github/setup.js, a 4.3 MB dropper. The triggers around it each abuse a legitimate auto-run feature of a different tool:

    • .claude/settings.json and .gemini/settings.json: a SessionStart hook that runs node .github/setup.js when an agent session opens.
    • .cursor/rules/setup.mdc: an always-applied rule that instructs the agent to run the file. That is a prompt injection shipped inside the repository.
    • .vscode/tasks.json: a task set to runOn: folderOpen, so no agent is even needed.
    • package.json: the test script is rewired to node .github/setup.js, so CI detonates it too.

    Cloning the repository is safe. Opening it is not. A developer who clones the project to debug an issue and opens the folder runs the payload with no further interaction. Treat unexpected .claude/, .gemini/, .cursor/, and .vscode/ files in a diff as supply chain signals, not editor noise.

  6. update

    How far it has spread

    At least 309 GitHub repositories now carry Miasma code, with stolen secrets dumped into hundreds of attacker-created dead-drop repos.

    Read the full update Show less

    At the time of writing, BleepingComputer reports 309 GitHub repositories have been compromised by the campaign, and the count is still climbing.

    The worm dumps what it steals into fresh public repositories that act as dead drops, each tagged with the description Miasma: The Spreading Blight. SafeDep and StepSecurity have catalogued several of the accounts holding them: liuende501 with 236 repos, windy629 with more than 200, and HerGomUli. Some of those repos carry a second, reversed string, niagA oG eW ereH :duluH-iahS, which reads back as "Shai-Hulud: Here We Go Again". OX Security separately counted 210 repositories already holding harvested credentials, a rough floor for how many developers have been infected.

  7. confirmed

    Why upgrading makes it worse

    Each package was hit in three publish waves. The first two were pulled, but the third is still the live latest, so upgrading to the newest patch installs the payload.

    Read the full update Show less

    This is the trap. SafeDep's root-cause analysis found the attacker published each package three times. The first two waves were unpublished after the fact, but the third wave bumped the patch number and remains the live latest on npm. [email protected], [email protected], and [email protected] all still ship the preinstall dropper.

    Upgrading to the latest patch installs the payload rather than removing it. Worse, every malicious version carries valid npm provenance, so npm audit signatures reports them as verified. Provenance attests to how a package was built, not that the build was authorized.

    Deleting node_modules is not enough either. Because the payload installs editor and CI persistence, anyone who installed an affected version should treat the host as compromised, isolate it, and rotate every credential it could reach.

  8. update

    Two arms in one day

    Miasma detonates on two surfaces at once: a 57-package npm wave that hides its trigger in binding.gyp, and direct pushes into source repos.

    Read the full update Show less

    On June 3 the campaign ran two parallel arms off the same stolen tokens. The npm arm, analysed by StepSecurity and JFrog, poisoned 57 packages across 286 or more versions and hid the trigger in a binding.gyp file rather than a package.json lifecycle script. When npm finds a binding.gyp and no install hook, it falls back to node-gyp rebuild, which executes shell commands embedded in the file, firing the payload before most lifecycle-script scanners ever look.

    The maintainer jagreehal alone had more than 50 npm packages compromised in that wave, including @vapi-ai/server-sdk, which sees over 408,000 monthly downloads. The second arm is the editor-focused GitHub push covered in the newest update above.

  9. analysis

    Built to hunt cloud identities

    Deeper analysis shows this variant added GCP and Azure identity collectors, endpoint-protection checks, a container escape, and per-infection encryption.

    Read the full update Show less

    Several firms published payload breakdowns. Wiz noted the standout change: new collectors for GCP and Azure cloud identities, a shift from grabbing secrets toward seizing the cloud accounts themselves. Socket traced exfiltration to api.anthropic[.]com:443/v1/api, a domain typosquatting the real Anthropic endpoint, with GitHub as a fallback channel. The fallback commits the stolen data with a taunting message: IfYouInvalidateThisTokenItWillNukeTheComputerOfTheOwner:<token>.

    The worm also checks for CrowdStrike, SentinelOne, Carbon Black, and StepSecurity Harden-Runner before acting, attempts a Docker-socket container escape that grants the CI runner passwordless sudo, and avoids running on Russian-language systems, the same tell seen in the GlassWorm campaigns. Separately, threat-intel firm WhiteIntel disclosed that an active Red Hat GitHub credential and session cookie had surfaced in infostealer logs on April 13 and May 15, weeks before the attack.

  10. update

    Red Hat pulls the packages

    Red Hat removed the affected versions and says the compromise was limited to internal development tooling, with no impact to customer systems.

    Read the full update Show less

    In a statement to BleepingComputer, Red Hat said it had removed the packages and that the damage was contained:

    The packages are strictly limited to internal development, and the malicious code was never published for customer consumption via the console.redhat.com system. While our investigation is ongoing, we have not identified any impact to customer or partner environments or Red Hat production systems.

    Maintainers published clean versions of all 32 packages. Red Hat did not answer questions about how the account was compromised in the first place.

  11. analysis

    Exactly how Miasma got in

    The attacker abused npm trusted publishing: a rewritten CI workflow on a throwaway branch traded a GitHub OIDC token for npm publish rights and signed valid provenance.

    Read the full update Show less

    Here is the mechanism end to end, pieced together from SafeDep, Aikido, and The Hacker News.

    1. Initial access. A Red Hat employee's GitHub account was compromised. The attacker pushed orphan commits straight to RedHatInsights repositories, bypassing code review.
    2. The publish trick. On three repos (javascript-clients, frontend-components, platform-frontend-ai-toolkit) the attacker created short-lived oidc-<hex> branches and rewrote the trusted CI workflow into a self-publishing job with id-token: write, running a Bun worm.
    3. Token exchange. That job swapped the workflow's GitHub OIDC token for an npm publish token, then for each target package downloaded the real tarball, injected a preinstall: node index.js hook plus a 4.3 MB dropper, and republished it with valid Sigstore provenance.
    4. The root cause. npm trusted publishing binds trust to a repository plus a workflow filename, not to a branch. A malicious branch running the same ci.yml filename was issued a publish token and signed as legitimate.

    On a victim machine the dropper runs at install time: a ROT-9 string is passed to eval, which decrypts two AES-128-GCM blobs, downloads Bun 1.3.13 from its official GitHub release, and runs a credential harvester that scrapes AWS, Azure, GCP, Vault, Kubernetes, npm, GitHub, and SSH secrets before propagating onward.

  12. confirmed

    The break: 96 poisoned versions in 72 seconds

    Aikido and OX Security catch backdoored versions of 32 @redhat-cloud-services packages published in a 72-second burst, every one carrying valid npm provenance.

    Read the full update Show less

    The campaign surfaced publicly on Monday when Aikido and OX Security flagged backdoored builds across Red Hat's npm scope. ReversingLabs clocked the publish burst at 72 seconds for all 32 packages, almost certainly automated.

    The numbers: 32 packages, 96 malicious versions, covering the entire Red Hat Hybrid Cloud Console JavaScript ecosystem with close to 10 million collective downloads and roughly 117,000 per week. Each package carried a preinstall hook that ran the stealer during npm install, before any application code, and the payload carried the signature string Miasma: The Spreading Blight.

  13. background

    Patient zero, three days before anyone noticed

    The first commit carrying the 'Miasma: The Spreading Blight' string lands, apparently a test run by the threat actor.

    Read the full update Show less

    Working backwards, OX Security found the first commit containing the Miasma: The Spreading Blight string on May 29, three days before public disclosure. The actor appears to have infected a repository early to test the tooling before the main run.

  14. background

    The credential was on sale weeks earlier

    A Red Hat GitHub credential and live session cookie surfaced in infostealer logs on April 13 and May 15, and TeamPCP had just open-sourced the worm.

    Read the full update Show less

    Two ingredients were in place before the attack. WhiteIntel detected an active Red Hat GitHub credential and session cookie in infostealer logs on April 13 and again on May 15. A session cookie matters because it represents an already-authenticated session that can be replayed without clearing MFA. WhiteIntel is careful to say it cannot confirm this exact credential was the one used, but the profile matches the reported initial access.

    The second ingredient: the cybercrime group TeamPCP, also tracked as Replicating Marauder, TGR-CRI-1135, and UNC6780, had just open-sourced its Mini Shai-Hulud worm, the framework Miasma is built on. That release means anyone could be driving this campaign, which is exactly why nobody has named the actor with confidence.