By NHI Mgmt Group Editorial TeamDomain: Breaches & IncidentsSource: CycodePublished September 21, 2025

TL;DR: The Shai-Hulud npm worm compromised 180+ packages, used postinstall execution to scan for API keys, tokens, and other credentials, and then exfiltrated stolen secrets through unauthorized GitHub Actions workflows, according to Cycode. The incident shows how developer tooling, CI/CD pipelines, and package trust models can turn a single dependency compromise into broad secrets exposure and propagation.


At a glance

What this is: This is a large-scale npm supply chain worm that steals secrets, creates rogue GitHub Actions workflows, and self-propagates across packages.

Why it matters: It matters because identity and access assumptions around developer machines, automation tokens, and CI/CD workflows can fail in minutes, not days, once a package is compromised.

By the numbers:

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


Context

Shai-Hulud is a software supply chain compromise, but the security problem is identity and secrets governance: a trusted package can become a delivery vehicle for credential theft, workflow abuse, and downstream propagation. The attack matters because npm installs often execute code in developer and CI/CD contexts where tokens, keys, and repository permissions are already available.

The first control failure is trust in package execution, followed by weak visibility into what credentials exist on workstations and runners. For teams running application security, IAM, and NHI programmes together, this is a reminder that software supply chain controls and secrets lifecycle controls now intersect at the same attack surface.


Key questions

Q: What breaks when a compromised package executes during import in CI/CD pipelines?

A: Import-time execution collapses the usual separation between dependency loading and code execution. Once the package runs on import, it can read environment variables, load companion payloads, and start secondary behaviour before most scanners or approval gates have any chance to intervene. The control failure is trusting package installation or import as a safe, passive step.

Q: Why do npm tokens and build credentials increase supply chain risk so quickly?

A: Because they are reusable non-human identities with privileges that outlive a single session. If an attacker steals a token that can publish packages or write automation, the compromise can spread from one repository to many others, turning a local infection into ecosystem-wide propagation.

Q: What do security teams get wrong about developer and CI secrets?

A: They often treat these secrets as operational conveniences instead of high-value identities. In practice, developer laptops and CI runners are rich credential stores, and tokens that remain valid for long periods are ideal for republishing, impersonation, and downstream access. Secrets should be governed like privileged access, not cache data.

Q: Who is accountable when a compromised workflow publishes secrets or malicious changes?

A: Accountability sits with the teams that own repository policy, workflow controls, and privileged access governance, not just the developer whose token was stolen. Organisations should map owner, admin, and automation rights to named control owners so incident response can trace both the compromise path and the permission decisions that enabled it.


Technical breakdown

How postinstall execution turns package trust into credential exposure

npm packages can execute scripts during installation, which means a dependency can run with the same context as the developer or CI/CD runner. In this attack pattern, the malicious postinstall script used a secret-scanning utility to search local files, environment variables, and caches for API keys, cloud credentials, and npm tokens. That makes the package itself the entry vector, while the runtime environment becomes the credential source. The control gap is not just malicious code detection. It is the absence of strong execution boundaries for package installs and the lack of hard separation between build-time tooling and secret-bearing contexts.

Practical implication: restrict install-time script execution and isolate build environments from long-lived credentials.

Why rogue GitHub Actions workflows amplify secrets theft

Once secrets are harvested, the attack used unauthorized GitHub Actions workflows to move data out of the repository context. This is especially effective because workflow files are normal automation artifacts, so their creation can blend into developer activity unless change monitoring is precise. In identity terms, the problem is delegated access with insufficient lifecycle control: a stolen token or write permission can create durable automation that outlives the original compromise. The attack also shows how CI/CD is not just an execution layer but an identity plane, where workflows, tokens, and repository permissions act like non-human identities with privileged capabilities.

Practical implication: monitor workflow creation as an identity event and require approval for new or changed automation.

How stolen npm tokens enable worm-like propagation

The worm propagated by using stolen npm publishing tokens to publish new malicious versions of other packages. That step converts a single compromise into a supply chain multiplier because publish rights are effectively non-human identity credentials with broad downstream reach. This is a classic NHI governance failure: a token that can publish code should be treated as a high-risk identity with scope, lifecycle, and revocation requirements, not as a convenience secret. The attack also illustrates why package ecosystems need tighter separation between maintainer identity, publishing privileges, and automation credentials.

Practical implication: treat package publishing tokens as privileged identities with strict scope, rotation, and revocation controls.


Threat narrative

Attacker objective: The attacker aims to steal reusable credentials, exfiltrate repository data, and turn trusted npm publishing rights into a self-spreading supply chain compromise.

  1. Entry occurred when a developer installed a compromised npm package that executed a malicious postinstall script in the local build context.
  2. Credential harvesting followed as the script scanned for API keys, cloud credentials, npm tokens, and other secrets on workstations and CI/CD runners.
  3. Escalation and propagation happened when stolen npm tokens were used to publish additional malicious package versions and extend the worm across the ecosystem.

Read our 52 NHI Breaches Analysis report for a comprehensive view of breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Package trust has become an identity risk, not just a software integrity issue. Shai-Hulud shows that a dependency can act as an execution identity with access to secrets, workflows, and publishing rights. That means software composition management and identity governance now overlap at build time, especially where npm tokens and CI/CD runners behave like privileged non-human identities. Practitioners should govern package execution as access control.

Secrets sprawl creates the blast radius this attack depends on. The worm succeeds because credentials are present in too many places at once: local caches, environment variables, pipeline runners, and maintainer accounts. Fragmented secrets management turns one compromised install into many exploitable identities. The named concept here is credential propagation surface: every place a secret can be copied becomes a separate compromise path. Teams should shrink that surface before assuming detection can keep up.

CI/CD workflows now need lifecycle controls that many identity programmes reserve for human access. Unauthorized workflow creation is not only a DevOps issue, it is a governance failure around non-human identity creation and persistence. If a token can create automation that runs repeatedly, then the token is effectively a standing identity with delegated authority. Practitioners should align pipeline governance with PAM-style oversight for high-risk automation.

Publishing tokens must be treated as privileged non-human identities. The attack converts npm publish rights into an automated propagation mechanism, which is exactly why scope, expiry, and revocation matter. Tokens that can release software are not ordinary secrets, and access review alone is too slow if the token can be abused between review cycles. Practitioners should classify publishing credentials as high-impact NHI assets.

Supply chain defence now requires secrets visibility at the point of execution. Traditional perimeter thinking fails when the compromise happens during install and the exfiltration happens through normal repository automation. That shifts the control question from 'did the package look trusted?' to 'what secrets were available when it ran?' Teams should connect secrets discovery, repository monitoring, and runtime containment into one operating model.

From our research:

  • The Shai-Hulud attack has affected 180+ packages, making it a potentially far-reaching incident, according to The State of Secrets in AppSec.
  • From our research: 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.
  • From our research: Read 52 NHI Breaches Analysis for more patterns that show how credential exposure turns into downstream compromise.

What this signals

Credential propagation surface: the practical risk is not only that a secret is stolen, but that it exists in enough places for the attacker to reuse it quickly. NHI programmes should map where credentials can be discovered, copied, and replayed across build systems, repositories, and maintainer accounts, then reduce that surface before the next package compromise lands.

The broader signal is that software supply chain defence is becoming a lifecycle problem for identities attached to automation. Package publishing rights, workflow creation rights, and CI/CD runner credentials all behave like privileged non-human identities, so they need ownership, expiry, and review discipline consistent with OWASP Non-Human Identity Top 10 and NIST SP 800-53 Rev 5 Security and Privacy Controls.

Teams should expect more attacks that blend secrets theft with repository automation rather than traditional malware delivery. That changes the operational question from 'was the dependency malicious?' to 'what could this dependency reach if it executed now?' and pushes detection closer to runtime and identity governance.


For practitioners

  • Disable install-time script execution where feasible Limit automatic execution of package postinstall hooks in developer and CI/CD environments, then allow only the packages that require it and are explicitly reviewed. This reduces the chance that a compromised dependency can immediately scan for secrets or modify workflows.
  • Rotate all exposed credentials as if stolen Assume npm tokens, cloud keys, and other secrets on impacted machines or runners have been compromised, then revoke and reissue them in priority order based on privilege and downstream reach.
  • Monitor GitHub Actions creation as a security event Alert on new workflow files, new YAML definitions, and changes to repository automation permissions, because rogue workflow creation is the exfiltration path in this attack pattern.
  • Treat publishing tokens as high-risk NHI assets Apply tight scope, short expiry, and mandatory revocation for package publishing credentials, with ownership mapped to the maintainer or automation account that can actually publish packages.
  • Pin dependencies and verify package provenance Lock known-good versions, compare installed packages against approved lists, and investigate any unexpected package updates or maintainer changes before they reach build pipelines.

Key takeaways

  • Shai-Hulud is a supply chain worm that turns trusted package installs into secret harvesting and propagation.
  • The incident shows that build-time credentials, GitHub Actions, and npm publishing tokens now function as high-risk non-human identities.
  • The most effective response is to cut execution trust, shrink secrets exposure, and govern automation rights like privileged access.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST CSF 2.0, NIST SP 800-53 Rev 5 and CIS Controls v8 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-03This attack exploits secret exposure and weak lifecycle control for package and pipeline credentials.
MITRE ATT&CKTA0006 , Credential Access; TA0009 , Collection; TA0010 , Exfiltration; TA0003 , PersistenceThe worm combines credential harvesting, collection, exfiltration, and persistence across packages.
NIST CSF 2.0PR.AC-4Least-privilege access is central because stolen tokens gained publishing and workflow rights.
NIST SP 800-53 Rev 5IA-5Authenticator management applies directly to npm tokens and other reusable secrets.
CIS Controls v8CIS-5 , Account ManagementAccount and token lifecycle controls are needed to stop compromised automation from persisting.

Map exposed publishing and runner credentials to NHI-03 and shorten their lifetime aggressively.


Key terms

  • Supply Chain Worm: A supply chain worm is malware that uses one compromise to propagate into adjacent packages, repositories, or automation systems. In identity terms, it becomes far more dangerous when it can harvest and replay secrets that let it publish, move, or persist without further exploitation.
  • Legacy publishing token: A long-lived authentication credential used to publish or manage packages in a repository. In NHI governance, the risk is not only theft but persistence, because an unrevised token can remain valid after newer controls are added and can bypass the intended identity path.
  • Rogue GitHub Actions Workflow: A rogue GitHub Actions workflow is an unauthorised automation file added to a repository so an attacker can exfiltrate data or run malicious logic under normal CI/CD execution. It is dangerous because it looks like legitimate pipeline code while acting as a covert data path.
  • Credential Propagation Surface: Credential propagation surface is the set of places where a secret can be discovered, copied, or reused after the first compromise. The larger that surface, the more quickly one stolen token or key can become a multi-system incident across repositories, build systems, and cloud services.

What's in the full analysis

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

  • Package-by-package compromise list and the affected npm versions for exposure checking
  • Cycode workflow for identifying unauthorized GitHub Actions and suspicious repository changes
  • Secrets detection and prioritisation details for rotation based on likely impact
  • CI/CD monitoring examples that show how the malicious workflow pattern can be detected in practice

👉 Cycode's full post covers the compromised package set, workflow indicators, and recommended containment steps.

Deepen your knowledge

The NHI Foundation Level course covers NHI governance, secrets management, workload identity, and agentic AI identity in a practitioner-focused format. It helps security and identity teams build the controls needed to govern non-human access with clarity and consistency.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 20, 2026.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org