Join our Newsletter — 33% off our NHI Course

Notifications
Clear all

npm publishing tokens and developer compromise: what IAM teams missed


(@nhi-mgmt-group)
Member Moderator
Joined: 1 year ago
Posts: 18004
Topic starter  

TL;DR: A compromised developer machine, an exfiltrated npm publishing token, and GitHub Actions abuse allowed malicious jscrambler package versions to be pushed to npm within minutes, according to Jscrambler. The incident shows how developer workstation secrets, automation workflows, and package release controls can turn a single credential theft into a supply chain event.

NHIMG editorial — based on content published by Jscrambler covering a compromise of the public jscrambler npm package and its release pipeline

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.
  • 64% of valid secrets leaked in 2022 are still valid and exploitable today, proving that detection alone is not enough without automated revocation.

Questions worth separating out

Q: What breaks when package publishing depends on long-lived credentials?

A: Long-lived publishing credentials turn a release pipeline into standing privilege.

Q: Why do developer workstations create such a high release-risk environment?

A: Developer workstations often hold cached credentials, SSH keys, and automation secrets in one place, so a single compromise can expose multiple trust paths.

Q: How do you know if package security controls are actually working?

A: Look for fewer unexpected publishes reaching build systems, lower rates of install-time outbound connections, and measurable reductions in secret exposure during pipeline execution.

Practitioner guidance

  • Harden package publishing with short-lived identity-bound credentials Replace reusable npm publish tokens with OIDC-backed or otherwise short-lived publishing credentials, and remove any secret that can be replayed from a workstation or automation job.
  • Separate workflow execution from release authority Restrict GitHub Actions jobs so they cannot access publish-grade secrets unless a human approves the release path, and keep source control write access distinct from registry publish rights.
  • Apply minimum release age to public dependencies Enable npm min-release-age or pnpm minimumReleaseAge so freshly published packages cannot be installed immediately during the highest-risk exposure window.

What's in the full analysis

Jscrambler's full report covers the operational detail this post intentionally leaves for the source:

  • The exact package versions, helper-package dependencies, and publication timeline tied to the malicious npm releases.
  • The specific response sequence, including revocation, deprecation, and the clean release process used to contain the incident.
  • The planned control changes around dual approval, OIDC publishing, and container hardening that were only summarised here.
  • The package-manager settings and release workflow adjustments that reduce exposure to newly published malicious dependencies.

👉 Read Jscrambler's report on the npm package compromise and release abuse →

npm publishing tokens and developer compromise: what IAM teams missed?

Explore further

View Full Forum →  |  NHI Foundation Course →



   
Quote
(@mr-nhi)
Member Moderator
Joined: 3 months ago
Posts: 17593
 

Standing release privilege is now a supply chain control failure, not just a DevOps hygiene issue. When a publish token survives on a developer machine or in automation, it creates a durable path from endpoint compromise to software distribution abuse. That is a governance problem for IAM, PAM, and NHI teams because the credential is acting as a non-human identity with release authority. The practical conclusion is that publishing rights need lifecycle control, scope limitation, and revocation discipline.

A few things that frame the scale:

  • 28.65 million new hardcoded secrets were detected in public GitHub commits in 2025 alone, a 34% year-over-year increase and the largest single-year jump ever recorded, according to The State of Secrets Sprawl 2026.
  • 64% of valid secrets leaked in 2022 are still valid and exploitable today, proving that detection alone is not enough without automated revocation.

A question worth separating out:

Q: Who is accountable when malicious code enters through a package registry?

A: Accountability usually spans the package maintainer, the registry controls, and the consuming organisation’s build governance. The maintainer identity is the publishing control point, but the consumer still owns script restrictions, lockfile enforcement, and credential protection on build systems. The right question is who owned each control layer, not who noticed the attack first.

👉 Read our full editorial: Compromised npm publishing tokens expose supply chain release risk



   
ReplyQuote
Share: