Join our Newsletter — 33% off our NHI Course

Notifications
Clear all

npm supply chain self-propagation: what security teams need to do


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

TL;DR: A trojanised npm package can exfiltrate secrets, plant persistence, and auto-republish itself across a maintainer’s package estate, impacting more than 180 packages in days, according to Apiiro’s analysis of the Shai-Hulud campaign. The pattern turns CI/CD secrets and package trust into the primary blast-radius controls, not just dependency hygiene.

NHIMG editorial — based on content published by Apiiro: LLMjacking: How Attackers Hijack AI Using Compromised NHIs

By the numbers:

Questions worth separating out

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.

Q: Why do maintainer credentials make npm supply chain attacks so dangerous?

A: Maintainer credentials are effectively publishing identities, so reuse or theft lets an attacker publish malicious updates under a trusted package name.

Q: What do teams get wrong about secrets in build automation?

A: Teams often assume build secrets are safe because the job is temporary, but the credential usually outlives the run.

Practitioner guidance

  • Restrict package lifecycle execution Disable or tightly gate post-install scripts in CI, and require explicit review for packages that execute code during install or introduce large opaque bundles.
  • Rotate all exposed developer and pipeline credentials Assume any npm token, GitHub PAT, SSH key, or cloud access key available during the compromise window has been exposed, then revoke and reissue them.
  • Mirror trusted registries for high-risk builds Use mirrored or allowlisted registries for production builds so a compromised public package cannot immediately reach release pipelines.

What's in the full analysis

Apiiro's full analysis covers the operational detail this post intentionally leaves for the source:

  • Package-by-package infection timeline and the full list of compromised npm releases
  • Indicator details for malicious bundle.js hashes, workflow names, and outbound webhook traffic
  • Response actions for cleaning developer machines, CI runners, and repository caches after exposure
  • Practical guidance on mirroring registries, provenance checks, and publication controls

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

npm supply chain self-propagation: what security teams need to do?

Explore further

View Full Forum →  |  NHI Foundation Course →



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

Supply chain security has become an identity governance problem, not just a code integrity problem. This campaign shows that maintainer credentials, npm tokens, and GitHub access are now the control plane for software trust. When a publishing identity can republish malware into every owned package, governance has failed before runtime detection even begins. Practitioners should treat package publishing rights as privileged access with lifecycle controls, not as routine developer convenience.

A few things that frame the scale:

  • The average estimated time to remediate a leaked secret is 27 days, despite 75% of organisations expressing strong confidence in their secrets management capabilities, according to The State of Secrets in AppSec.
  • Only 44% of developers are reported to follow security best practices for secrets management, exposing a significant developer behaviour gap.

A question worth separating out:

Q: Who is accountable when a supply chain package compromise reaches developer systems?

A: Accountability typically spans the engineering team that approved the dependency path, the platform team that defined install policy, and the security function that set provenance and monitoring requirements. Frameworks such as NIST CSF and MITRE ATT&CK help assign responsibility across prevention, detection, and response.

👉 Read our full editorial: Shai-Hulud shows how npm supply chain attacks now self-propagate



   
ReplyQuote
Share: