Book a demo

Shai-Hulud 2.0 npm packages compromise campaign

By CERT AlgoSecure2 min readLire en français

Our CERT AlgoSecure team is currently monitoring the spread of a new wave of the so-called “Shai-Hulud” attack, now identified as Shai-Hulud 2.0. It is an infostealer spreading through the NPM ecosystem, using compromised maintainer accounts to publish malicious versions of legitimate packages.

This extended version of the attack enables secret exfiltration, propagation to other packages and, in some variants, destructive or automated actions on development environments.

Main technical indicators (IOCs)

  • Malicious files observed: setup_bun.js, bun_environment.js
  • Injected install script: « preinstall »: « node setup_bun.js »
  • Files generated at install time: cloud.json, contents.json, environment.json, truffleSecrets.json
  • Unauthorised GitHub workflow added: .github/workflows/discussion.yaml
  • Automated creation of public GitHub repositories containing the exfiltrated secrets
  • Possible deletion of the user’s home directory, depending on the variants observed

Local detection

  • Search projects for the malicious files:

find . -name "setup_bun.js" \ -o -name "bun_environment.js" \ -o -name "cloud.json" \ -o -name "contents.json" \ -o -name "environment.json" \ -o -name "truffleSecrets.json"

  • Review NPM logs for suspicious entries:

grep -R "shai" ~/.npm/_logs grep -R "preinstall" ~/.npm/_logs

Potential impact

  • Exfiltration of GitHub secrets, NPM tokens, cloud credentials (AWS, GCP, Azure) and CI/CD secrets
  • Compromise of development pipelines and risk of propagation to other projects
  • Automatic replication across several packages from the same maintainer
  • Destruction of local data in some scenarios

Recommendations

  • Monitor for the presence of the malicious files and artefacts listed above
  • Review all NPM dependencies used in your projects
  • Delete node_modules, clear the NPM cache and reinstall dependencies from verified versions
  • Disable or restrict preinstall/postinstall scripts in CI/CD environments
  • Rotate GitHub tokens, cloud keys and CI/CD secrets if exposure is suspected
  • Review GitHub repositories for workflows added without authorisation or public repositories created automatically.

We are here to support you fully in analysing this threat; do not hesitate to contact us with any questions.

Sources

List of affected packages: https://github.com/wiz-sec-public/wiz-research-iocs/blob/main/reports/shai-hulud-2-packages.csv

https://helixguard.ai/blog/malicious-sha1hulud-2025-11-24

https://www.wiz.io/blog/shai-hulud-2-0-ongoing-supply-chain-attack

https://about.gitlab.com/blog/gitlab-discovers-widespread-npm-supply-chain-attack/

https://www.cert.ssi.gouv.fr/actualite/CERTFR-2025-ACT-051/