The Shai Hulud worm is a self replicating supply chain attack that steals npm tokens, GitHub credentials, AWS keys and Kubernetes secrets from developer machines and CI/CD pipelines. It spreads by republishing infected versions of trusted npm and PyPI packages. Researchers count more than 170 affected packages with over 518 million cumulative downloads.
What Is the Shai Hulud Worm?
Instead of phishing a company or delivering ransomware, the attackers poison software that developers already trust and install automatically. That makes this campaign one of the most dangerous supply chain attacks of 2026, because the attack surface is no longer just endpoints and firewalls. It now includes CI/CD pipelines, GitHub Actions, npm registries, package maintainers, cloud identities and developer workstations.
Researchers from Aikido Security, Endor Labs, Socket, SafeDep, Snyk and Microsoft investigated the campaign after finding malicious package versions that harvest secrets from developer systems. We have tracked the same pattern in other incidents, including the Red Hat supply chain compromise of npm packages and the Databricks TeamPCP attack on CI/CD pipelines.
Which Packages and Companies Were Affected?
Reports link the campaign to packages connected to the following projects and ecosystems:
- TanStack
- Mistral AI
- OpenSearch
- Guardrails AI
- UiPath
- Other npm ecosystems and PyPI repositories
- CI/CD environments that installed the affected versions
Researchers estimate more than 170 packages and over 518 million cumulative downloads, so the exposure reaches well beyond the named projects.
How Does the Worm Steal Secrets and Spread?
The malware uses a multi stage design built for developer environments. Obfuscated JavaScript payloads first profile the system they run on, then collect secrets and send them out. The targets include environment variables, .npmrc files, GitHub Actions secrets, AWS credentials, Kubernetes configurations, CI/CD runners, cloud deployment tokens and local developer secrets.
A realistic attack chain looks like this:
- Attackers compromise a maintainer’s credentials
- Malicious npm package versions are published
- Developers and pipelines install them automatically
- Install scripts run and harvest credentials
- Cloud tokens are collected and GitHub OIDC access is abused
- The CI/CD environment is compromised and attackers move laterally
- The worm enumerates other packages the maintainer can publish, injects its payload and republishes them with a higher version number
Hidden install scripts, detached background processes, silent execution and error suppression help it stay quiet. Microsoft researchers also found geofenced destructive logic that can run damaging commands under certain regional conditions.
Why Does Signed Provenance Not Mean a Package Is Safe?
This is the most alarming finding. The attackers hijacked GitHub Actions publishing workflows and abused OpenID Connect (OIDC) authentication, so the malicious versions were published through legitimate infrastructure with valid provenance signatures. Many teams treat a signed package as a safe one. This campaign shows that provenance proves where a package was built, not that the build was trustworthy.
What Secrets Does the Malware Target?
- npm publishing credentials and tokens
- GitHub personal access tokens and CI/CD tokens
- AWS secrets and Azure cloud tokens
- Kubernetes credentials
- Docker registry access
- SSH keys and API secrets
Investigators also saw functionality aimed at cryptocurrency wallets, AI tooling and messaging applications.
Who Is at Risk From the Shai Hulud Worm?
Enterprises depend heavily on npm and cloud native pipelines. A single compromise can expose source code repositories, production cloud infrastructure, customer data, Kubernetes clusters, AI environments and enterprise authentication systems.
Small and mid sized businesses often lack mature DevSecOps, supply chain monitoring, software composition analysis and dedicated threat hunting, so the same attack can land harder with less warning.
Cloud environments are exposed because stolen tokens can lead to AWS account compromise, Kubernetes takeover, container compromise and lateral movement. Recovery is disruptive, with emergency credential rotation, CI/CD shutdowns, software rebuilds and possible outages. Supply chain incidents can also create compliance exposure under SOC 2, ISO 27001, GDPR, HIPAA, PCI DSS and NIST frameworks.
How Do You Detect Shai Hulud Worm Activity?
Start with visibility into what your builds and developer machines actually install.
- Dependency monitoring: watch for unexpected package updates, suspicious versions, unauthorized dependency changes, hidden install scripts and integrity check failures
- EDR: alert on unauthorized command execution, environment variable access, token harvesting and unusual npm execution
- SIEM: build detections for GitHub token misuse, OIDC anomalies, suspicious package publishing, Kubernetes secret access and cloud credential abuse
- Threat hunting: search for obfuscated JavaScript payloads, suspicious install scripts, unauthorized GitHub Actions usage and secret exfiltration attempts
- Identity monitoring: look for privilege escalation, session hijacking, MFA bypass attempts and abnormal GitHub authentication
How Do You Mitigate the Shai Hulud Worm?
- Remove compromised packages immediately
- Rotate every exposed credential
- Audit your full dependency tree
- Restrict GitHub Actions permissions and limit OIDC token scope
- Enforce MFA everywhere
- Restrict who can publish packages and audit npm maintainers
- Use private package registries and validate provenance carefully
- Harden Kubernetes, segment development infrastructure and tighten cloud identity controls
- Deploy software composition analysis and monitor developer endpoints
- Run incident response exercises for a supply chain scenario
Newer package manager protections help as well. See how pnpm 11 blocks risky new package installs and how the GitHub data breach showed the same supply chain risk.
What Should Security Teams Take From This Attack?
Zero Trust has to apply to software development itself. Dependencies, signed packages, automated workflows, provenance attestations and open source ecosystems all need continuous validation, because attackers now go after the delivery pipeline instead of the endpoint.
The fastest way to learn whether your pipeline is exposed is to test it from the attacker’s side. Our team runs penetration testing and vulnerability assessments, and our PTaaS platform keeps that testing continuous between audits.
Key Takeaways
- The Shai Hulud worm steals npm, GitHub, AWS and Kubernetes secrets and spreads by republishing infected packages.
- Researchers count more than 170 affected packages and over 518 million cumulative downloads.
- Valid provenance signatures were obtained through hijacked GitHub OIDC tokens, so a signed package is not automatically safe.
- Rotate credentials, limit OIDC scope, enforce MFA and restrict publishing rights.
- Test your CI/CD pipeline the way an attacker would.
Frequently Asked Questions About the Shai Hulud Worm
What is the Shai Hulud worm?
It is a self replicating supply chain malware campaign that spreads through malicious npm and PyPI package versions. It steals npm tokens, GitHub credentials, AWS keys, Kubernetes secrets and other credentials from developer machines and CI/CD pipelines.
How does the Shai Hulud worm spread?
After stealing a maintainer’s credentials, it finds other packages that person can publish, injects its payload, raises the version number and republishes them. Each new infection steals more credentials and repeats the cycle.
Does a signed package mean it is safe from the Shai Hulud worm?
No. Researchers found that attackers hijacked GitHub OIDC tokens and published malicious versions through legitimate GitHub Actions workflows, so the packages carried valid provenance signatures.
What should I do if I installed an affected package?
Remove the package, rotate every credential the machine or pipeline could reach, including npm, GitHub, AWS and Kubernetes secrets, then review recent publishing and cloud activity for anything you did not authorize.
How can I reduce the risk of npm supply chain attacks?
Limit GitHub Actions and OIDC token scope, enforce MFA, audit dependency trees, restrict who can publish packages, use a private registry, and test your build pipeline the way an attacker would.

