By NHI Mgmt Group Editorial TeamBased on OXSecurity: ““Shai-Hulud, Here We Go Again”: 170+ Packages Hit Across npm & PyPi” (May 12, 2026)

TL;DR: Shai-Hulud has resurfaced across npm and PyPI, affecting 170+ packages, 518,765,599 monthly downloads, 379 GitHub repositories with stolen credentials, and packages used by Mistral AI, OpenSearch Project, and TanStack, according to OXSecurity. The pattern shows how compromised non-human identities can turn package installs into credential theft, persistence, and destructive follow-on actions.


At a glance

What this is: Shai-Hulud is a self-spreading npm and PyPI malware wave that steals credentials, self-propagates through package install paths, and now includes wipe logic tied to token revocation.

Why it matters: It matters because package ecosystems are becoming identity attack surfaces, and NHI governance now has to cover install-time trust, token exposure, and revocation-safe response.

By the numbers:

  • Shai-Hulud now affects over 170 packages across npm and PyPI.
  • OXSecurity says 379 GitHub repositories have stolen credentials from the campaign.

Context

Shai-Hulud is a supply chain malware pattern, but the operational problem is identity exposure at install time. When package hooks execute before a developer has reviewed the code path, credentials, tokens and environment variables can be captured before conventional controls see the event. That makes package ecosystems part of the identity perimeter, not just the software supply chain.

The NHI angle is direct because the malware targets machine credentials, API keys and tokens rather than only human accounts. In practice, that means service identities, CI runners and developer tooling all become propagation paths when trust is anchored in install scripts and long-lived secrets.

The current wave is not typical software bloat or routine malicious package noise. It shows a mature abuse pattern where compromise, persistence and destructive response logic are bundled into the same execution chain.


Key questions

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. That lets attacker-controlled scripts read memory, steal secrets, and potentially publish more malicious artifacts before defenders notice. The control that breaks is the assumption that dependency installation is operationally harmless. Treat install-time execution as a governed security boundary, not a routine developer convenience.

Q: Why do stolen NHI credentials make supply chain malware so hard to contain?

A: Because the stolen credential can become both the exfiltration channel and the propagation channel. Once a registry token, GitHub token or CI secret is exposed, the attacker can publish new artefacts, modify existing packages or plant repository markers that outlive the initial infection. Containment has to assume the identity itself is part of the compromise.

Q: What are the signs that package credential abuse is already underway?

A: Warning signs include repeated authentication attempts, unusual requests against API key endpoints, publish actions from unfamiliar locations, and code that cycles through variants to find a valid token. In practice, teams should look for bursty access patterns, unexpected package creation, and credential use that does not match normal maintainer behavior or release timing.

Q: When should teams revoke package and CI tokens after a malware hit?

A: Revoke them as soon as a host with those credentials is suspected to be infected, but only after the endpoint is isolated and evidence is preserved. If the malware is designed to react to revocation, a blunt token reset can trigger destructive follow-on behaviour. Response has to sequence containment before credential invalidation.


Technical breakdown

Why npm install hooks are a credential-execution boundary

npm lifecycle hooks such as preinstall run during package installation, before a human typically inspects the code in detail. Attackers abuse that boundary by placing logic in package metadata or bootstrap scripts so the payload executes as part of a normal developer workflow. Once execution starts, the malware can read environment variables, local credential caches and tokens available to the build or developer machine. The important design flaw is that trust is granted to the package name and version before the install-time behaviour is validated.

Practical implication: Treat package install hooks as executable code paths and restrict or monitor them in build and developer environments.

How stolen tokens become a propagation mechanism

After collecting credentials, the malware can upload them to attacker-controlled infrastructure and to attacker-owned repositories, then use those identities to publish or modify packages. That turns a single compromised machine into a distribution node. Because package ecosystems reuse trust across maintainers, registries and CI systems, a stolen token can create a second-order compromise that looks legitimate to downstream consumers. In this pattern, the credential is not just an access artefact. It is the mechanism that expands the blast radius.

Practical implication: Inventory and scope package-publishing tokens separately from developer logins, and revoke registry tokens when any credential theft is suspected.

Why revocation-triggered wipe logic raises the stakes

This variant reportedly adds a token monitor that checks whether the stolen credential is still active, then triggers destructive behaviour if revocation is detected. That is a coercion pattern, not just persistence. It changes incident response because token invalidation can now be paired with local damage, which means defenders need containment that isolates the endpoint before the adversary can pivot to deletion. The combination of persistence, credential theft and destructive follow-on action shows the malware is designed to punish response as well as enable initial compromise.

Practical implication: Plan revocation actions with endpoint isolation and forensic preservation in place before removing attacker-controlled tokens.


Threat narrative

Attacker objective: The objective is to convert trusted package installs into a reusable credential theft channel that also supports propagation and sabotage.

  1. Entry occurs when a developer or CI pipeline installs a compromised npm or PyPI package that executes malicious bootstrap code.
  2. Credential harvest follows as the payload extracts tokens, API keys and environment secrets from the host and build context.
  3. Escalation and spread occur when stolen credentials are uploaded, reused or leveraged to publish additional poisoned packages and extend the compromise.
  4. Impact is credential theft at scale, repository contamination and destructive wipe behaviour if the victim revokes the captured token.

Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Package install time has become an identity control point: Shai-Hulud shows that the real security boundary is no longer only repository review or registry trust. The dangerous moment is package execution during install, when machine credentials and developer secrets are exposed to code that has already been granted runtime access. Organisations that treat install hooks as low-risk metadata are misplacing the control boundary.

Secret leakage is now a propagation primitive: In this campaign, stolen tokens are not merely exfiltrated, they become the means to publish, poison and extend the attack. That creates a distinct failure mode we can call credential-enabled package propagation, where a compromised NHI becomes a distribution channel for further compromise. The control gap is lifecycle governance over the tokens that can change software artefacts.

Revocation-safe incident response is now part of NHI governance: If malware can respond to token revocation by wiping a machine, then response playbooks that assume clean invalidation are incomplete. The governance assumption that revocation is inherently safe has failed here. Practitioners need containment logic that recognizes destructive retaliation as part of the attacker’s design, not an edge case.

Package ecosystems should be treated as NHI attack surfaces: Service accounts, automation tokens and CI identities often have more effective reach than human users inside build pipelines. When those identities are reused across registries, GitHub and cloud tooling, a single malicious package can move from code execution to environment compromise without ever needing a password prompt. NHI inventory and scoping must extend into the software supply chain.

Supply chain malware is converging with agentic trust abuse: The malware’s use of token monitoring, self-propagation and conditional destructive behaviour mirrors the same governance challenge seen in autonomous systems: delegated access can be repurposed faster than static review processes can react. That is why machine identity control needs to be lifecycle-based, not event-based. Practitioners should manage package-publishing authority as privileged access, not convenience.

What this signals

Credential-enabled package propagation: Shai-Hulud is a useful label for the failure mode where stolen tokens are not merely stolen, but reused to extend package compromise across registries, repositories and CI pipelines. That means governance has to shift from single-event detection to lifecycle control over any identity that can publish software or alter build inputs.

The practical signal for practitioners is that package ecosystems should be managed as part of identity security, not just software intake. If install scripts, registry tokens and GitHub access are governed separately, attackers can move faster than revocation workflows can react.

When token revocation can trigger hostile behaviour, incident response needs containment before cleanup. That puts endpoint isolation, artefact preservation and identity scoping ahead of the familiar instinct to rotate first and investigate later.


For practitioners

  • Block install-time execution where possible Restrict preinstall and similar lifecycle hooks in build pipelines, developer workstations and package automation paths so unreviewed code cannot execute during installation.
  • Rotate and revoke exposed machine credentials Treat package registries, CI systems, GitHub tokens and environment secrets as compromised if they were present on an infected host, then rotate them in a controlled sequence.
  • Hunt for attacker marker strings Search repositories and logs for the reported marker string and related repository creation patterns, then correlate findings with package install events and token use.
  • Tighten package publishing authority Separate publishing tokens from general developer access, remove unnecessary write scope, and require stronger authentication for any identity that can alter package artefacts.
  • Isolate revocation workflows from endpoints When a token theft is suspected, isolate the machine before invalidating credentials so destructive malware cannot immediately trigger wipe logic on the host.

Key takeaways

  • Shai-Hulud is not just another malicious package wave, it is a credential-led supply chain pattern that turns NHI compromise into propagation.
  • The article ties the latest wave to 170+ packages, 518,765,599 monthly downloads and 379 GitHub repositories with stolen credentials, showing material scale.
  • The control gap is install-time trust and revocation-safe response, so teams need tighter package execution controls and stronger NHI lifecycle governance.

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 CSA Cloud Controls Matrix and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-02 — Secret LeakageThe malware’s primary effect is theft of tokens, API keys and other secrets from build contexts.
NHI-04 — Insecure AuthenticationStolen registry and GitHub tokens are used as trusted authentication material in the attack chain.
NHI-07 — Long-Lived SecretsThe campaign succeeds because reusable tokens remain valid long enough to be stolen and repurposed.
Recommendation — Scan package installs and build logs for leaked secrets, then revoke any exposed NHI credentials immediately. Reduce trust in long-lived tokens and enforce stronger authentication for identities that can publish artefacts. Shorten token lifetimes and revoke any long-lived NHI secrets that can reach package and CI systems.
MITRE ATT&CKTA0006;TA0010;TA0040 — Credential Access; Exfiltration; ImpactThe campaign steals credentials, exfiltrates them and can end in destructive wipe behaviour.
Recommendation — Map package-compromise detections to credential access, exfiltration and impact stages in your threat hunting pipeline.
CSA Cloud Controls MatrixIAM — Identity and Access ManagementCloud and developer access governance is central because the malware abuses tokens and publishing identities.
Recommendation — Apply IAM governance to separate publishing rights from everyday developer access and limit token scope.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsThe attack exploits over-broad entitlements on package registries, GitHub and CI identities.
Recommendation — Review and reduce package-publishing entitlements under PR.AA-05 for all automation identities.

Key terms

  • Self-spreading package malware: Malicious code that uses package install paths and credential theft to copy itself through software ecosystems. It turns routine dependency handling into a propagation channel, often by abusing lifecycle hooks, registry access and stolen maintainer or CI tokens.
  • Build-Time Trust Boundary: A build-time trust boundary is the line that separates dependency installation and compilation from access to sensitive credentials or production systems. When that boundary is weak, malicious packages can turn routine automation into a path for broader compromise.
  • Credential-enabled propagation: A compromise pattern where stolen tokens or keys are not only exfiltrated but reused to spread the attack further. The credential becomes an active mechanism in the campaign, expanding reach across registries, repositories and automation systems.
  • Revocation-triggered destructive logic: Malware behaviour that reacts to credential invalidation by damaging the host or data. It changes incident response because token removal can trigger retaliation, making containment and isolation essential before revocation is performed.

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. It is designed for teams that need to govern machine identities, secrets management, and access risk across modern delivery pipelines.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 2, 2026.
Updated on October 12, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org