Join our Newsletter — 33% off our NHI Course

Does the Shai-Hulud 2.0 npm attack turn install-time into identity abuse?

 

(@nhi-mgmt-group)
Member Moderator
Joined: 2 years ago
Posts: 20230
Topic starter  

TL;DR: Unosecur's analysis of the Shai-Hulud 2.0 npm supply chain attack finds compromised maintainer accounts, malicious package versions, and stolen cloud credentials, GitHub tokens, and CI/CD secrets stored in more than 25,000 attacker-controlled repositories. Teams need tighter control over install-time credential reach, not just package trust.

Editorial analysis by NHI Mgmt Group, based on content published by Unosecur: “Shai-Hulud 2.0: Responding to the 2025 npm Supply Chain Attack”.

Key questions

Q: Why do standing CI/CD tokens create so much risk in supply chain attacks?

A: Standing tokens remain usable long after the moment they were created, so a compromise can persist through normal operations and even through partial remediation.

Q: How do teams know if a dependency compromise has become a persistence problem?

A: Look for unrecognised self-hosted runners, unexpected workflows, new branches, repeated secret access, and tokens being used from places they should never reach.

Q: What breaks when malicious npm packages execute during CI/CD installs?

A: The main failure is that package installation becomes code execution inside a trusted build context.

Practitioner guidance

  • Restrict install-time script execution Block or tightly gate npm lifecycle scripts in CI/CD and other build systems that process unvetted dependencies, especially where secrets are present.
  • Inventory exposed cloud and GitHub credentials Map every cloud key, GitHub token, CI/CD credential, npm token, and SSH key reachable from build and developer contexts, then revoke anything that was exposed.
  • Replace reusable secrets with short-lived scoped credentials Remove long-lived secrets from pipelines and local developer environments, and move to short-lived credentials with tight scope wherever installation-time code can run.

Bottom line: The incident shows that npm supply chain compromise can become cloud identity abuse when build environments expose reusable secrets.

Glossary terms: Preinstall Hook, Credential Harvesting, Identity Blast Radius, Self-hosted runner

What's in the full article

Unosecur's full blog covers the operational detail this post intentionally leaves for the source:

  • The exact malware behaviour across preinstall, exfiltration, runner registration, and republishing steps
  • The list of credential types harvested from developer and CI/CD environments
  • The GitHub artefacts, workflow tricks, and repository patterns used to hide stolen data
  • The post-incident cleanup actions for revoking tokens and checking for persistence

👉 Read Unosecur's analysis of the Shai-Hulud 2.0 npm supply chain attack →

Explore further

View Full Forum →  |  NHI Foundation Course →  |  Our Services →  |  Read the full analysis →


This topic was modified 3 weeks ago by NHI Mgmt Group

   
Quote
(@mr-nhi)
Member Moderator
Joined: 7 months ago
Posts: 20718
 

Package trust is now an identity problem, not a code-review problem: the moment a dependency can execute during install, package provenance stops being the only boundary that matters. In this campaign, npm delivery became a credential collection mechanism because build and developer contexts already contained usable cloud and automation secrets. The practitioner conclusion is simple: identity posture now determines the blast radius of dependency risk.

A few things that frame the scale:

A question worth separating out:

Q: How should teams respond when a malicious npm package can steal build secrets?

A: Treat the package as a credential exposure event, not just a dependency incident. Revoke and rotate every secret that the affected build environment could access, then inspect GitHub, CI runners, and secret manager logs for abnormal access, repository creation, and unexpected automation artefacts.

👉 Read our full editorial: Shai-Hulud 2.0 shows how npm supply chains expose cloud identity risk



   
ReplyQuote
Share:

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.