Security & privacy

GitHub enforces 48-hour expiry on unvalidated npm trusted publishers

GitHub now expires unvalidated npm trusted publishing configurations after 48 hours to prevent package hijacking via repository slug reuse.

Illustration of a digital lock securing a numeric ID while a nameplate detaches
Illustration generated for this article

GitHub has implemented a strict 48-hour expiration policy for unvalidated npm trusted publishing configurations following the discovery of a critical supply chain vulnerability. This change, announced in October 2026, prevents attackers from hijacking package namespaces by claiming abandoned repository slugs before the original owner publishes a version.

What happened

The update addresses a loophole known as "SlugFest," identified by researchers at Bloom Security and reported to GitHub on June 6, 2026. The vulnerability allowed attackers to push malicious code to over 1,500 npm packages that had been downloaded more than 10 million times. The core issue lay in how npm verified the identity of repositories using trusted publishing, a feature introduced in July 2025 to eliminate long-lived credentials.

Trusted publishing uses OpenID Connect (OIDC) tokens to authenticate CI/CD pipelines without storing secrets. However, npm initially validated these tokens based on the repository slug—the human-readable "owner/repository" path—rather than the immutable numeric ID assigned by GitHub. If a maintainer renamed, transferred, or deleted a repository without ever publishing a package, the slug became available for anyone to claim. An attacker could create a new repository with the same slug, generate a valid OIDC token, and trick npm into granting publish access to the original package name.

To mitigate this, GitHub now requires that any newly created trusted publisher configuration must complete its first successful publish within two days. This action validates the configuration and binds it to the repository's immutable identity. If the deadline is missed, the configuration expires. Additionally, npm will no longer accept trusted publishing tokens generated from GitHub Actions issue_comment events, reinforcing restrictions already in place for pull_request_target events.

How it works

Trusted publishing relies on a trust relationship between the package registry and the CI/CD provider. When a workflow runs, GitHub mints a short-lived OIDC token containing metadata about the repository, including its numeric ID and slug. Previously, npm checked only the slug against its pre-authorized list. If the slug matched, npm issued a publish token, ignoring the fact that the numeric ID might belong to a completely different repository created by an attacker.

The new mechanism enforces a "use it or lose it" rule. Upon creating a trusted publisher entry, a 48-hour window opens. During this time, the configuration remains unvalidated. If a successful publish occurs, npm records the immutable repository ID associated with that slug, locking the trust relationship. Subsequent renames or transfers will require a new trust setup, restarting the validation window. Ordinary edits to the configuration do not reset this timer, ensuring that stale or unused bindings cannot be exploited indefinitely.

Key details

  • Vulnerability name: SlugFest, discovered by Bloom Security.
  • Impact scope: Over 1,500 vulnerable npm packages with more than 10 million cumulative downloads.
  • New policy: Unvalidated trusted publishing configurations expire 48 hours after creation.
  • Validation trigger: The first successful publish binds the configuration to the repository's immutable numeric ID.
  • Additional restrictions: Npm rejects trusted publishing tokens from GitHub Actions issue_comment events.
  • Attack prerequisite: The victim’s repository slug must be available (unpublished) and claimable by an attacker.

Why it matters

For software engineers and technical founders, this incident highlights the fragility of human-readable identifiers in security systems. Relying on slugs rather than immutable IDs creates a race condition where repository hygiene directly impacts supply chain integrity. As AI agents increasingly automate dependency resolution and updates, the risk of silently pulling malicious versions grows. These agents often prioritize the latest version without verifying provenance, making them ideal vectors for cascading attacks like SlugFest.

The fix also changes operational workflows for maintainers. Teams can no longer set up trusted publishing well in advance of their first release without risking expiration. This requires tighter coordination between CI/CD configuration and initial package publication. Furthermore, the rejection of issue_comment tokens reduces the attack surface for workflows that trigger on user interactions, which are often less controlled than merge-based events.

What you can do

  • Audit your existing trusted publisher bindings to ensure the listed repository slug still resolves to a repository under your control.
  • Delete and recreate trust bindings immediately if you have renamed, transferred, or deleted the associated repository.
  • Monitor your npm account for unexpected publish events, especially from repositories that have never published before.
  • Ensure your first package publish occurs within 48 hours of creating a new trusted publisher configuration.
  • Review GitHub Actions workflows to remove reliance on issue_comment triggers for publishing tasks.
  • Verify that your CI/CD pipelines are using the latest GitHub Actions runners to support the updated OIDC token structure.
  • #npm
  • #github
  • #supply-chain-security
  • #devops
  • #oidc

Tools from the Bytechap store

Keep reading

All stories