TL;DR: The Shai-Hulud worm has reemerged through a malicious bun_environment.js package, and several npm accounts, including @asyncapi and @posthog, appear compromised, underscoring how dependency trust can be weaponised across the SDLC, according to Veracode. Software supply chain security now depends on faster package verification, blocking, and policy enforcement, not just after-the-fact detection.
At a glance
What this is: Veracode reports a renewed Shai-Hulud npm worm campaign using a malicious bun_environment.js package and affected npm accounts.
Why it matters: For IAM and NHI practitioners, the incident reinforces that compromised package publisher identities and high-trust dependency paths can become an access and delivery channel into development environments.
👉 Read Veracode's analysis of the Shai-Hulud npm worm and affected packages
Context
The Shai-Hulud return is a supply chain security problem, not just a malware story. When attackers compromise package publishing ecosystems, they can turn normal developer trust into a delivery path for malicious code, and the blast radius extends into build systems, browsers, and end users. For identity teams, the intersection is real: publisher accounts, package signing trust, and secrets in CI/CD all sit inside the same governance boundary.
Open-source dependency ecosystems fail when trust is assumed at publication time and verified too late, or not at all. That makes this a governance issue as much as a detection issue. The fact pattern is typical of modern supply chain abuse, where one compromised package can become a repeatable distribution mechanism across many consuming environments.
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 compromised package publisher identities matter for supply chain security?
A: Because the publisher identity is often the trust anchor for accepting updates. If that identity is hijacked, attackers can push malicious code under a name developers already trust. This turns identity compromise into software delivery compromise, which is why maintainer accounts, publishing tokens, and automation credentials need formal governance.
Q: How do security teams know whether dependency controls are actually working?
A: Look for blocked install attempts, reduced exposure of secrets during package installation, and fewer unapproved packages reaching build and runtime environments. If malicious or newly suspicious packages can still execute scripts, the control boundary is too weak. Effective programmes prove that risky packages are stopped before they become executable inputs.
Q: Who is accountable when a malicious package reaches production systems?
A: Accountability usually sits across security, engineering, and platform operations. Engineering controls the dependency choices, security defines the detection and response requirements, and platform teams govern build pipelines and package trust policies. Frameworks such as NIST CSF, NIST 800-53, and MITRE ATT&CK support shared ownership of prevention, detection, and response.
Technical breakdown
How malicious npm packages propagate through trusted dependency chains
A package worm works by abusing the normal software consumption model. Developers and CI pipelines treat packages as trusted inputs, so if a malicious package is published under a familiar namespace or dependency path, it can enter many environments before anyone notices. In supply chain attacks, the attacker often relies on obfuscation, suspicious update timing, or compromised maintainer access to keep the package in circulation long enough to spread. The real risk is not only code execution, but also the capture of surrounding secrets, tokens, and build context.
Practical implication: enforce package provenance checks and block unknown or newly suspicious packages before they reach build pipelines.
Why package firewalling and policy enforcement matter in SDLC controls
Package firewalling sits between external repositories and internal development workflows, creating a gate where high-risk packages can be inspected or blocked. Policy enforcement adds the governance layer by defining what is allowed to install, execute, or transit through the SDLC. This matters because many attacks exploit the gap between discovery and remediation. If a malicious package can be installed before detection completes, the organisation has already lost control of the dependency boundary.
Practical implication: pair allowlists, blocklists, and installation policies so publishing events do not become automatic trust events.
Secrets exposure is often the second-stage objective
Supply chain malware commonly aims beyond initial compromise. Once code is executed in developer or build environments, attackers look for secrets, session tokens, cloud credentials, and other non-human identities that unlock adjacent systems. That makes secrets governance central to supply chain defence. If tokens are present in local environments, pipelines, or package-maintainer tooling, a single malicious dependency can become a credential harvesting point as well as a delivery mechanism.
Practical implication: reduce standing secret exposure in build and developer environments, especially where packages can execute scripts.
Threat narrative
Attacker objective: The attacker seeks repeated distribution through trusted package channels while harvesting credentials and extending compromise across the software delivery chain.
- Entry occurs when a malicious npm package is published into a trusted dependency ecosystem and consumed by downstream developers or pipelines.
- Escalation occurs when the package executes within build or development contexts and gains access to tokens, secrets, or installation privileges.
- Impact occurs when the worm spreads through repeated package consumption and can expose credentials, compromise accounts, or extend into browser and end-user environments.
Breaches seen in the wild
- Shai Hulud npm malware campaign — Shai Hulud campaign: npm malware exposed secrets on GitHub.
- Reviewdog GitHub Action supply chain attack — reviewdog/action-setup GitHub Action supply chain attack exposed secrets.
Read our 52 NHI Breaches Analysis report for a comprehensive view of breaches impacting Non-Human Identities including AI Agents.
NHI Mgmt Group analysis
Shai-Hulud is a dependency trust failure, not just a malware variant. The central issue is that software delivery still assumes package ecosystems are trustworthy until proven otherwise, which leaves a large window for malicious publishing. For identity and NHI governance, that same trust model applies to publisher accounts, automation tokens, and build identities. Practitioners should treat package trust as an access-control problem, not only a malware-scanning problem.
The named concept here is dependency trust collapse: when a package ecosystem’s publication model is used as the attack path, the organisation loses the ability to distinguish legitimate updates from malicious ones in time. That collapse is amplified when CI/CD systems accept packages automatically and when secrets are available during installation or testing. The practical lesson is that provenance, policy, and blast-radius controls must sit ahead of installation, not after it.
Compromised npm accounts demonstrate that publisher identity is part of the attack surface. A package name alone is not a sufficient trust signal if the maintainer account or publishing workflow has been hijacked. This is where NHIMG’s identity lens adds value: human and non-human identities both matter in software supply chains, because both can be abused to distribute malicious code. Teams should therefore govern publisher identity with the same seriousness as privileged access.
Reactive detection is necessary, but it is not a containment strategy. Verifying packages after they are already in circulation leaves organisations exposed to repeated installation attempts and downstream propagation. The category is moving toward pre-install controls, policy-based blocking, and environment-level restrictions because the attack surface is now distribution itself. Practitioners should assume that malicious packages will evade simple reputation checks and prepare controls that fail closed.
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: Only 44% of developers are reported to follow security best practices for secrets management, according to The State of Secrets in AppSec.
- Forward look: Read The 52 NHI breaches Report to see how compromised credentials and trust failures repeatedly turn into broader access events.
What this signals
Dependency trust is becoming an identity problem as much as a software problem. When publisher accounts, build tokens, and automation identities can be abused to distribute malicious packages, the control conversation shifts from scanning to governance. Organisations that rely on detection alone will keep discovering compromise after the fact, which is too late for modern SDLC risk. The operational response is to tighten provenance, block execution by default, and govern the identities that publish software.
The secret exposure window is the key programme metric here. If secrets can survive long enough to be harvested from developer or build contexts, a package compromise becomes a credential incident as well as a supply chain event. That is why identity controls, secrets handling, and package policy need to be managed together, not in separate workstreams. For deeper context on where these failures recur, see 52 NHI Breaches Analysis.
The practical signal for practitioners is whether malicious dependency paths are stopped before installation, not after alerting. If a compromised package can still reach the SDLC, the organisation has not yet established a fail-closed dependency boundary. Teams should align package policy, secrets hygiene, and software supply chain monitoring around one question: can untrusted code execute before governance intervenes?
For practitioners
- Enforce pre-install package controls Block unknown, newly modified, or suspicious packages before they enter CI/CD, and require policy checks at the repository boundary rather than relying on post-install alerts.
- Separate build trust from dependency trust Run package installation in constrained environments that do not expose long-lived credentials, cloud tokens, or developer secrets during dependency resolution.
- Review publisher and maintainer identity Treat package maintainer accounts, publishing tokens, and automation identities as governed assets with rotation, revocation, and offboarding controls.
- Map dependency risk to NHI exposure paths Identify where package scripts can read secrets, reach artifact stores, or trigger downstream automation so you can contain the non-human identities they might abuse.
Key takeaways
- Shai-Hulud’s return shows that trusted package ecosystems remain a viable delivery path for malware and credential abuse.
- Compromised publisher identities turn dependency trust into an access problem, which expands the blast radius beyond the build system.
- Practitioners should move controls left of installation, because blocking malicious packages before execution is more effective than remediating after spread.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
MITRE ATT&CK and OWASP Non-Human Identity Top 10 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.
| Framework | Control / Reference | Relevance |
|---|---|---|
| MITRE ATT&CK | TA0002 , Execution; TA0006 , Credential Access; TA0003 , Persistence | The campaign relies on malicious package execution and possible credential harvesting through trusted software flows. |
| NIST CSF 2.0 | PR.AC-1 | Package trust and access boundaries fit CSF protection controls for controlled software intake. |
| NIST SP 800-53 Rev 5 | CM-8 | Asset and software inventory are needed to identify affected packages and constrain intake. |
| CIS Controls v8 | CIS-2 , Software Inventory | Software inventory is essential for tracking package exposure across development environments. |
| OWASP Non-Human Identity Top 10 | NHI-03 | Compromised automation tokens and secrets in package workflows are a non-human identity exposure problem. |
Map malicious package behavior to execution, credential access, and persistence techniques, then block those paths pre-install.
Key terms
- Dependency Trust Collapse: The point at which software consumers can no longer reliably distinguish legitimate packages from malicious ones using normal trust signals. In practice, it happens when package publication, maintainer identity, and install-time execution are all assumed safe without independent verification.
- Package Firewall: A package firewall is a control point that inspects, allows, blocks, or quarantines software packages before they reach development or runtime environments. It reduces supply chain risk by enforcing policy at the ingestion boundary rather than depending on later detection.
- Secret exposure window: A secret exposure window is the period between when a credential becomes visible to an attacker and when it is detected, revoked, or rotated. In CI/CD environments that window can be extremely short, which is why detection speed and identity-linked revocation matter as much as storage hygiene.
- Publisher Identity: Publisher identity is the account, token, or automation identity used to release software into a package ecosystem. When it is compromised, attackers can push malicious updates under a trusted name, making identity governance a core supply chain control.
What's in the full analysis
Veracode's full post covers the operational detail this post intentionally leaves for the source:
- The known affected package list and how it changes as new malicious releases are identified.
- Package Firewall and SCA handling details for organisations that need execution-time control decisions.
- Veracode's ongoing detection and blocking approach for anomalous publishing behaviour and obfuscated code.
- The threat-research update cadence for tracking new npm campaign variants.
👉 Veracode's full post covers the affected package list, blocking logic, and response guidance.
Deepen your knowledge
The NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, machine identity security, secrets management, and identity lifecycle controls. It is designed for practitioners who need to connect identity governance to broader security operations.
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