Join our Newsletter — 33% off our NHI Course

Why did Shai-Hulud spread so far through npm secrets?

 

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

TL;DR: Shai-Hulud showed that static secrets let one package compromise spread through npm and CI/CD environments, according to Defakto Security. npm publishing needs shorter-lived identity and tighter secret scope to limit replay after a leak.

Editorial analysis by NHI Mgmt Group, based on content published by Defakto Security: “Shai-Hulud npm Supply Chain Attack: Why Secrets Fueled the Worm”.

Key questions

Q: Why do reusable credentials increase supply chain risk in build systems?

A: Reusable credentials remain valid long enough to be copied, cached, logged, or exfiltrated.

Q: How do security teams know whether secret rotation is actually working?

A: Rotation is working only if exposed credentials are found quickly, revoked everywhere they are used and replaced before attackers can reuse them.

Q: What breaks when CI/CD pipelines rely on static secrets?

A: Static secrets create a reusable attack path into production infrastructure.

Practitioner guidance

  • Eliminate long-lived npm publish tokens Replace durable publish credentials with runtime-issued identities that exist only for the publishing task and expire automatically when the job completes.
  • Audit secret exposure across build paths Search package scripts, CI logs, environment variables, and developer workstations for reusable credentials that can be copied and replayed.
  • Scope non-human access to single tasks Limit each workload credential to the exact repository, registry, and publish action it needs so compromise cannot be reused for lateral propagation.

Bottom line: Shai-Hulud showed that static secrets can turn a single package compromise into rapid supply chain propagation across npm and CI/CD environments.

Glossary terms: Static Secret, Standing Privilege, Secrets Sprawl, Dynamic Ephemeral Identity

Explore further

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


This topic was modified 2 weeks ago by NHI Mgmt Group

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

Static secrets are a supply chain liability, not a convenience layer. The Shai-Hulud worm succeeded because reusable credentials were already embedded across build and developer environments. That means the security failure is not only compromise, but the decision to let non-human access persist in forms that can be copied and replayed. The practitioner implication is that any programme still depending on static publish tokens is preserving its own attack surface.

A few things that frame the scale:

  • 71% of NHIs are not rotated within recommended time frames, increasing the risk of compromise over time, according to the Ultimate Guide to NHIs.

A question worth separating out:

Q: What should organisations do first when package signing or publishing secrets are exposed?

A: Contain the exposure by revoking the affected credentials, then remove any workflow that still depends on those long-lived secrets. After that, replace the publishing path with ephemeral identity so the same secret cannot be stolen and replayed in the next build or install cycle.

👉 Read our full editorial: Shai-Hulud proves static npm secrets turn one leak into spread


This post was modified 2 weeks ago by NHI Mgmt Group

   
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.