Subscribe to the Non-Human & AI Identity Journal

What breaks when CI pipelines still rely on standing npm tokens?

Standing npm tokens turn a release workflow into a reusable identity artifact. If the token is stolen, the attacker can reuse it outside the intended run, publish malicious packages, and often pivot into adjacent secrets on the same runner. The break is not only authentication. It is the collapse of containment around machine identity.

Why Standing npm Tokens Break Release Containment

Standing npm tokens turn a CI job into a long-lived credential holder instead of a bounded build step. That breaks the security assumption most pipelines still rely on: that each run is isolated, disposable, and easy to revoke. Once a token persists across runs, compromise is no longer limited to the current build. It becomes a reusable identity artifact that can be replayed, copied, or abused after the pipeline has finished.

This is the same failure pattern seen in broader secrets sprawl and supply chain compromise. NHIMG’s Guide to the Secret Sprawl Challenge shows how often secrets survive far beyond their intended scope, while the CI/CD pipeline exploitation case study illustrates how runner compromise quickly turns into credential reuse and downstream access. NIST Cybersecurity Framework 2.0 also reinforces that credential exposure is an operational resilience issue, not just an authentication issue. In practice, many security teams discover the blast radius only after a package publish, runner compromise, or secret dump has already occurred, not during the design of the pipeline.

How the Failure Chain Works in Practice

With a standing npm token, the pipeline authenticates as a durable identity rather than a per-run workload. If the token is injected into environment variables, written to logs, copied into artifacts, or extracted from a compromised runner, an attacker can reuse it outside the intended execution window. That means the attacker does not need to stay inside the build job. They can publish malicious packages, overwrite legitimate releases, or probe adjacent systems where the runner also has access.

The core problem is that static, role-based access control is too coarse for autonomous or semi-autonomous build workflows. A build job does not need a permanent publishing identity. It needs a narrowly scoped, short-lived capability for one task. Best practice is moving toward just-in-time credential issuance, runtime policy checks, and workload identity, so the build proves what it is and what it is allowed to do at execution time. That approach fits the guidance in NIST Cybersecurity Framework 2.0 and the operational lessons from NHIMG’s Shai Hulud npm malware campaign.

  • Issue tokens per job, not per team or per repository, and revoke them automatically at completion.
  • Prefer short TTLs and workload-bound credentials over long-lived npm automation tokens.
  • Separate publish permissions from build permissions so a compromised runner cannot become a package maintainer.
  • Store secrets outside the pipeline when possible, and treat any runner-local secret as exposed once the runner is compromised.

Where this guidance breaks down most often is in legacy release infrastructure that reuses the same runner image, cache, and credentials across multiple projects because the environment is optimized for speed rather than isolation.

Common Exceptions, Tradeoffs, and Migration Gaps

Tighter token controls often increase release friction, so organisations have to balance delivery speed against containment. That tradeoff is real, especially for teams with frequent publishes, shared runners, or older automation that assumes one static token can serve every job. Best practice is evolving, and there is no universal standard for every npm workflow yet.

The most common edge case is partial migration: teams rotate the token but keep the same broad privileges, or they move the token into a vault but still let the runner retrieve it for every build. That reduces exposure but does not eliminate replay risk. Another common gap appears when the same CI token is reused across multiple repositories or environments, which turns one compromised pipeline into a lateral movement path. NHIMG’s Guide to the Secret Sprawl Challenge and Reviewdog GitHub Action supply chain attack both show how quickly a single exposed secret can multiply into broader compromise. Current guidance suggests treating npm publishing as a privileged action that should be separately gated, audited, and revoked per run. The model fails fastest in shared CI estates where one runner image, one cache, and one persistent token are reused across many pipelines.

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-03 Standing tokens are long-lived NHI credentials that should be rotated and constrained.
OWASP Agentic AI Top 10 A-03 CI jobs behave like autonomous workloads that need bounded, runtime-scoped authorization.
CSA MAESTRO I2 MAESTRO addresses workload identity and least privilege for autonomous execution paths.
NIST AI RMF AI RMF governance applies to identity and containment risk in autonomous build systems.
NIST CSF 2.0 PR.AC-4 Access control and least privilege are directly implicated by reusable npm tokens.

Replace persistent npm tokens with short-lived, workload-bound credentials and automate rotation and revocation.