Subscribe to the Non-Human & AI Identity Journal

Notifications
Clear all

Shai-Hulud v2: what npm supply chain teams need to fix now


(@nhi-mgmt-group)
Member Moderator
Joined: 1 year ago
Posts: 15051
Topic starter  

TL;DR: Shai-Hulud v2 has affected 525+ npm packages and 132 million monthly downloads, with new behaviour that steals secrets and adds GitHub Actions persistence, according to Semgrep and Aikido. The incident shows that leaked secrets, token scope, and runner trust assumptions now create a combined supply chain identity problem, not just a malware problem.

NHIMG editorial — based on content published by Semgrep covering the Shai-Hulud v2 npm supply chain compromise: Shai-Hulud attack details and response guidance

By the numbers:

  • 64% of valid secrets leaked in 2022 are still valid and exploitable today, proving that detection alone is not enough without automated revocation.

Questions worth separating out

Q: What breaks when a malicious npm package can read developer secrets during install?

A: The main failure is that package execution inherits identity context it should never need.

Q: Why do long-lived npm and GitHub tokens make supply chain worms harder to contain?

A: Because a stolen token is not just a credential, it is delegated authority.

Q: How do security teams know whether a package compromise has become CI/CD persistence?

A: Look for new GitHub workflows, newly created repositories, unfamiliar runner registrations, and unusual audit-log entries tied to repository automation.

Practitioner guidance

  • Audit install-time execution paths Search package manifests for preinstall, postinstall, and similar hooks that can run before review.
  • Rotate publishing and workflow tokens now Revoke npm tokens, GitHub tokens, and cloud provider keys exposed to affected repositories or runners.
  • Review self-hosted runner trust boundaries Inventory self-hosted runners, inspect GitHub audit logs for newly created repositories or suspicious runner registration, and reimage hosts that may have executed malicious workflow code.

What's in the full analysis

Semgrep's full article covers the operational detail this post intentionally leaves for the source:

  • The exact malicious file changes added to infected repositories, including the preinstall hook and workflow persistence code.
  • Step-by-step detection queries for GitHub audit logs, repository search, and affected runner identifiers.
  • Concrete remediation steps for maintainers, including package rollback, cache cleaning, and token rotation sequencing.
  • The specific Semgrep rules and auto-scan workflow used to detect the persistence payload.

👉 Read Semgrep's analysis of the Shai-Hulud npm worm v2 →

Shai-Hulud v2: what npm supply chain teams need to fix now?

Explore further

View Full Forum →  |  NHI Foundation Course →



   
Quote
(@mr-nhi)
Member Moderator
Joined: 3 months ago
Posts: 14635
 

Shai-Hulud v2 is a secrets governance failure disguised as package malware. The worm does not need a new exploit class to succeed because it feeds on already-trusted NHI material such as npm tokens, cloud keys, and GitHub credentials. That means the core control gap is not detection at the edge, but unmanaged secrets inside the software delivery chain. Practitioners should treat every package install path as an identity trust boundary.

A few things that frame the scale:

  • 64% of valid secrets leaked in 2022 are still valid and exploitable today, according to The State of Secrets Sprawl 2026.
  • 28.65 million new hardcoded secrets were detected in public GitHub commits in 2025 alone, a 34% year-over-year increase and the largest single-year jump ever recorded.

A question worth separating out:

Q: Who is accountable when stolen software supply chain credentials are used to publish malicious code?

A: Accountability sits across the maintainer, platform, and security functions because publishing rights, token scope, and runner governance all contribute to the failure. Under NHI governance, the owner of the credential lifecycle is responsible for limiting the blast radius of any stolen token.

👉 Read our full editorial: Shai-Hulud npm worm v2 exposes the identity gaps in supply chains



   
ReplyQuote
Share: