Subscribe to the Non-Human & AI Identity Journal

Why do package supply chain attacks create NHI risk?

Because the attacker usually wants the non-human credentials behind the build and release process, not just the infected package. Service tokens, repository tokens, and cloud keys let malware pivot from one compromise to many. When those identities have broad scope or long lifetimes, package compromise becomes an access-control problem, not just a software integrity problem.

Why This Matters for Security Teams

Package supply chain attacks are dangerous because they target the trust layer behind software delivery. A compromised package can expose signing workflows, CI/CD runners, repository tokens, artifact registries, cloud APIs, and release automation, which are all non-human identities with real execution authority. That means the blast radius is not limited to one vulnerable dependency; it can extend across build systems, deployment pipelines, and production environments. The problem is well documented in NHIMG research such as the 52 NHI Breaches Analysis and the LiteLLM PyPI package breach, where credential exposure became the real security event.

Security teams often focus on package integrity checks, yet attackers increasingly aim for the secrets and workload identities that let them move from one poisoned dependency to many downstream systems. This is why supply chain security and NHI governance are now inseparable. Current guidance from the OWASP Non-Human Identity Top 10 and NIST Cybersecurity Framework 2.0 both point toward stronger identity controls, but package ecosystems still leave broad, long-lived automation credentials in places that are hard to inventory. In practice, many security teams encounter the NHI problem only after a package compromise has already exposed build tokens or cloud access, rather than through intentional identity lifecycle control.

How It Works in Practice

A package supply chain attack becomes an NHI issue when the malicious package or maintainer compromise is used as a foothold to steal or abuse credentials used by automation. Those credentials are often embedded in CI jobs, developer workstations, pipeline variables, deployment scripts, package publishing accounts, or bot accounts that approve changes. Once stolen, they can be reused outside the original system, which is why static secrets are so attractive to attackers.

For defenders, the practical response is to treat package pipelines as identity-bearing systems. That means the build process should use workload identity where possible, short-lived tokens instead of reusable secrets, and policy checks that evaluate each request in context. In mature setups, a pipeline step receives only the access it needs for that task, such as publishing to one registry or reading one artifact store, and that access expires when the job ends. This is a direct application of non-human identity hygiene: inventory the identities, bind them to workloads, reduce scope, and rotate or revoke aggressively. The Ultimate Guide to NHIs – Why NHI Security Matters Now explains why these identities are often the overlooked control plane, while the Shai Hulud npm malware campaign shows how quickly secret exposure can cascade across repositories and automation.

Useful implementation patterns include:

  • Replace long-lived repository and cloud keys with ephemeral credentials issued per build or release.
  • Use workload identity for runners and bots so the pipeline proves what it is, not just what secret it holds.
  • Apply least privilege to package publish, signing, and deployment actions.
  • Monitor for secret scanning hits, unusual token use, and cross-environment reuse of automation accounts.

These controls tend to break down in highly distributed build environments with unmanaged runners and copied secrets because identity sprawl makes revocation and attribution too slow.

Common Variations and Edge Cases

Tighter pipeline controls often increase engineering overhead, requiring organisations to balance release speed against containment and revocation discipline. That tradeoff is especially visible in open-source ecosystems, legacy CI systems, and multi-tenant build platforms where one team cannot easily enforce a single identity model.

There is no universal standard for every package workflow yet, but current guidance suggests that the highest-risk pattern is any automation identity with broad repository, registry, or cloud permissions and a long lifetime. In those environments, a malicious package does not need to be “powerful” on its own. It only needs to touch a secret, token, or signing path that was already over-privileged. This is why NHIMG’s Top 10 NHI Issues is useful here: package compromise often exposes the same failure modes seen in other NHI incidents, especially excessive privilege and weak lifecycle controls.

NHIMG’s research on The 2024 ESG Report: Managing Non-Human Identities found that 72% of organisations have experienced or suspect they have experienced a breach of non-human identities. That matters here because package attacks rarely stop at code integrity; they reveal whether the environment can actually contain and rotate the identities that software depends on. In practice, package supply chain security becomes much stronger once teams stop asking only “Is this package trusted?” and start asking “What automation identities can this package reach?”

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, OWASP Agentic AI Top 10 and CSA MAESTRO address the attack and risk surface, while NIST AI RMF and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-01 Package attacks abuse exposed non-human credentials and over-privileged automation.
OWASP Agentic AI Top 10 A-04 Autonomous toolchains and package automation need request-time authorization and containment.
CSA MAESTRO IAM-02 Agent and workload identities must be short-lived and tightly scoped across pipelines.
NIST AI RMF AI risk governance applies when automation can independently reach secrets and release systems.
NIST CSF 2.0 PR.AC-4 Least-privilege access management is central to limiting blast radius after package compromise.

Inventory every build, publish, and deploy identity, then remove unused or over-scoped credentials.