By NHI Mgmt Group Editorial TeamDomain: Breaches & IncidentsSource: PantherPublished April 24, 2026

TL;DR: Shai-Hulud is a self-propagating npm worm that harvested credentials from build environments, reused stolen tokens to spread downstream, and persisted through GitHub Actions runners, according to Panther and CERT/CC. The incident shows that package removal alone does not close the compromise when CI secrets, runners, and cloud credentials remain exposed.


At a glance

What this is: Shai-Hulud is a self-propagating npm supply chain attack that turns build-time secret exposure into downstream package infection and persistence.

Why it matters: It matters because CI/CD systems now carry NHI risk as well as software risk, and identity teams need to treat tokens, runners, and cloud keys as part of the same governance surface.

By the numbers:

  • When AWS credentials are exposed publicly, attackers attempt access within an average of 17 minutes and as quickly as 9 minutes in some cases.

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


Context

Shai-Hulud is a supply chain compromise that starts inside the software build path but quickly becomes an identity problem. The key failure is not only malicious code execution, but the fact that npm tokens, GitHub credentials, and cloud secrets are all present in the same runtime environment, which lets one compromise cascade across systems.

For NHI practitioners, the lesson is direct: service tokens, CI runners, and pipeline credentials behave like non-human identities with lifecycle, ownership, and rotation requirements. For security teams running cloud, DevOps, and identity programmes separately, this is a reminder that build infrastructure is already part of the identity estate, not just an engineering concern.


Key questions

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. Once a malicious install can read environment variables, local files, and CI secrets, it can steal credentials that survive beyond the original infection. That turns a code dependency problem into an access-control incident, because the attacker gains reusable authentication material, not just a one-time foothold.

Q: Why do service tokens in CI pipelines create more risk than ordinary application secrets?

A: CI tokens often carry broad trust, long lifetimes, and access to source control, registries, or cloud APIs. That makes them high-value non-human identities rather than simple configuration values. When one is stolen, the attacker can publish code, modify workflows, or move into cloud accounts without needing further phishing or malware.

Q: What do security teams get wrong about detecting malicious packages?

A: They often focus on known-bad signatures and miss behaviour that looks legitimate until the package runs. A dependency can be harmless in static review but malicious at runtime, especially when it reads credential files, spawns subprocesses, or calls unexpected external endpoints. Behavioural telemetry is the control that closes that gap.

Q: How should teams respond when GitHub Actions runners are used for persistence?

A: They should treat the runner layer as a privileged execution boundary and verify ownership, registration history, and workflow integrity before restoring trust. Self-hosted runners that appeared during the incident should be removed or rebuilt, and workflow changes should be checked for direct-push modifications and hidden secret access.


Technical breakdown

How the npm worm turns package install into credential harvesting

Shai-Hulud uses lifecycle scripts such as preinstall or postinstall to execute before or during package installation. That timing matters because the malicious code runs inside the same build context that holds environment variables, registry tokens, and injected cloud credentials. Once the payload reads process.env or credential files, it can exfiltrate secrets without needing elevated access first. The attack also survives ordinary package removal because the compromise occurs in the surrounding build environment, not only in the package artifact itself.

Practical implication: isolate package installation from privileged secrets and block lifecycle-script execution where possible.

Why GitHub Actions runners create persistence after the initial compromise

The campaign used self-hosted GitHub Actions runners and rogue workflow files to preserve access after the infected package was removed. A self-hosted runner is effectively execution infrastructure with trusted access to repositories, workflows, and downstream systems. If an attacker can register a runner or alter workflows, they gain a durable control point that sits outside simple package scanning. That is why the incident moved from code execution to persistence: the attacker kept a foothold in the automation layer, where change control is often weaker than in production systems.

Practical implication: inventory runners, verify workflow integrity, and remove any self-hosted execution path that lacks explicit ownership.

How stolen npm and cloud credentials extend the blast radius

Once the worm steals npm tokens or cloud keys, it can publish the next malicious version or reuse the same identity to access cloud resources. This is classic NHI abuse: a non-human credential is treated as durable trust, even though the attacker now controls it. The result is cross-domain spread from package registry to source control to cloud IAM. Behavioural detection is more effective than signatures here because the malicious code can change form while still following the same sequence of secret access, outbound exfiltration, and follow-on publication.

Practical implication: correlate npm, GitHub, CI, and cloud logs around secret access and token use, not just malware hashes.


Threat narrative

Attacker objective: The attacker wants to harvest trusted NHI credentials, persist inside build automation, and use those identities to spread the compromise downstream.

  1. Entry begins with maintainer phishing or a trojanised package that executes during the npm lifecycle and lands inside the build environment.
  2. Credential access follows when the payload reads process.env, registry tokens, and other injected secrets, then exfiltrates them through GitHub-hosted or workflow-based channels.
  3. Escalation and persistence occur when stolen tokens publish compromised versions and register GitHub Actions runners to maintain access beyond package cleanup.
  4. Impact is downstream package propagation, continued reuse of exposed cloud and repository credentials, and broader supply chain compromise across teams.

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


NHI Mgmt Group analysis

NHI lifecycle discipline is now a supply chain control, not just an identity control. The article shows that npm tokens, GitHub PATs, and cloud keys all function as non-human identities with ownership, rotation, and decommissioning requirements. When those credentials live inside CI pipelines, the attack surface extends from software delivery into identity governance. The practical conclusion is that pipeline credentials need the same lifecycle rigor as any privileged service account.

Standing trust in CI runners is the governance gap Shai-Hulud exploited. The worm succeeded because build infrastructure was allowed to execute code with access to secrets and then preserve that access through runner persistence. That creates an invisible trust corridor between package install, source control, and cloud access. The control failure is not merely missing malware detection, but the absence of enforced separation between execution and credential custody.

Behavioral detection is the correct response model for self-propagating supply chain malware. Signatures miss what matters when the payload can mutate while keeping the same operational sequence. The durable pattern is secret access, unexpected outbound connection, and follow-on publication or workflow modification. For defenders, this means policy and telemetry must be built around credential use patterns, not file names or hashes.

Shai-Hulud is a reminder that autonomous propagation changes the threat model for non-human identities. The attacker no longer needs interactive control after the initial foothold because the worm uses the environment's own identities to move. That is a direct challenge to governance models that assume non-human credentials are static and reviewable after the fact. Practitioners should treat automated trust paths as first-class security dependencies.

Supply chain resilience now depends on NHI containment, not just dependency hygiene. The code package is only the first layer of the incident. The higher-risk layer is the credential set exposed to the infected runner, because those identities can continue to act after the package is removed. The field implication is clear: identity governance must extend into DevSecOps, or supply chain cleanup will remain partial.

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.
  • 43% of security professionals are concerned about AI systems learning and reproducing sensitive information patterns from codebases.
  • From our research: The average estimated time to remediate a leaked secret is 27 days, while 44% of developers follow secrets-management best practices, according to The State of Secrets in AppSec.

What this signals

Secret exposure in CI should now be treated as an identity incident, not a tooling incident. Once a build runner reads and reuses a credential, the organisation has lost control of a non-human identity with active authority. For teams running GitHub Actions, npm, or cloud federation, the practical shift is to define containment steps for token theft before the next install event completes.

Credential blast radius is the concept practitioners need to operationalise. The question is no longer whether a secret leaked, but how far that secret can move across source control, package registries, and cloud APIs before it is invalidated. That makes ownership, scoping, and rapid revocation the decisive controls, especially when secrets are shared across multiple automation layers.

A useful reference point is the OWASP Non-Human Identity Top 10, which frames secret exposure, overprivilege, and lifecycle failure as governance problems rather than isolated misconfigurations. Teams that align their pipeline controls to OWASP Non-Human Identity Top 10 and map attacker behaviour to MITRE ATT&CK Enterprise Matrix are better placed to spot propagation paths before they become persistence.


For practitioners

  • Harden package execution paths Disable lifecycle scripts where feasible, pin exact dependency versions, and use npm ci in CI so a malicious patch release cannot execute arbitrary install-time code. Review build steps that implicitly trust preinstall or postinstall hooks.
  • Rotate all credentials exposed to build runners Treat any runner that executed a compromised package as fully exposed. Revoke npm tokens, GitHub PATs, cloud access keys, and any secrets injected into the environment, then validate that new credentials are scoped and time-bounded.

Key takeaways

  • Shai-Hulud shows that a package compromise can become an identity compromise when CI runners, tokens, and cloud credentials are in the same trust boundary.
  • The incident demonstrates that self-propagating supply chain malware can persist after package removal if runner access and stolen secrets are not revoked.
  • The limiting control is not only malware detection but rapid NHI rotation, runner auditing, and behavioural correlation across build and cloud telemetry.

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-01Secret exposure and lifecycle failure are central to the worm's spread.
MITRE ATT&CKTA0006 , Credential Access; TA0003 , Persistence; TA0008 , Lateral MovementThe attack relies on credential theft, runner persistence, and propagation across trusted systems.
NIST CSF 2.0PR.AC-1Access control failure sits at the centre of exposed build and cloud identities.
NIST SP 800-53 Rev 5IA-5Authenticator management is directly implicated by token theft and reuse.
CIS Controls v8CIS-5 , Account ManagementAccount and token ownership is the practical control gap in the incident.

Map runner and token abuse to ATT&CK tactics and prioritise telemetry for secret access plus publication events.


Key terms

  • Non-Human Identity (NHI): A digital identity assigned to a non-human entity such as a software application, service account, API key, bot, machine, or AI agent that enables it to authenticate and interact with systems without direct human involvement. NHIs now outnumber human identities in most enterprises by 25 to 50 times.
  • Lifecycle Script: A lifecycle script is package-manager code that runs automatically at install, publish, or uninstall time. In supply chain attacks, it becomes a trusted execution path that can read secrets, alter workflows, and persist before defenders realise the package has been weaponised.
  • Runner Persistence: Runner persistence is the use of CI or build execution infrastructure to retain access after the original malicious artifact is removed. It matters because the attacker no longer depends on the infected package alone and can continue acting through trusted automation assets.
  • Credential Blast Radius: Credential blast radius is the amount of access, data, and system reach that a single compromised secret can unlock. The wider the blast radius, the more damage one leaked token or certificate can cause. Reducing it requires tighter scope, faster revocation, and better segmentation.

What's in the full article

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

  • The attack-chain walkthrough from maintainer phishing through secret harvesting, exfiltration, and self-propagation.
  • The exact detection logic for anomalous CI runner behaviour, workflow injection, and cloud credential reuse.
  • The remediation examples for npm token revocation, GitHub runner review, and CloudTrail correlation.
  • The version-specific changes in Shai-Hulud V2, including preinstall execution and runner persistence.

👉 Panther's full post covers the attack chain, detection rules, and remediation steps for Shai-Hulud.

Deepen your knowledge

NHI Mgmt Group covers identity security, NHI governance, and agentic AI through independent research, practitioner guides, and the NHI Foundation Level course, the industry's only accredited NHI security programme. It is suited to teams that need to govern credentials, lifecycle, and privilege across modern security programmes.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 2, 2026.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org