SlugFest: npm and GitHub Trusted Publishing Slug Validation Flaw Exposes 1,500+ Packages
A slug validation flaw within npm Trusted Publishing enables attackers to hijack GitHub Actions OIDC-based publishing workflows, compromising over 1,500 npm packages. By exploiting insufficient package slug scoping, threat actors can impersonate maintainers, obtain valid OIDC identity tokens, and inject malicious versions into the npm registry. This vulnerability facilitates remote code execution (RCE) via dependency injection, posing a significant risk to AI agents and automated CI/CD pipelines. To mitigate the risk, GitHub has implemented a mandatory 48-hour session expiry for npm Trusted Publishing sessions to narrow the exploitation window.
-
Vulnerability Mechanics: OIDC Scoping Flaws
- npm Trusted Publishing relies on GitHub Actions OIDC identity tokens for automated, passwordless releases.
- Insufficient validation of package slugs allows OIDC tokens to be reused across unrelated publishing workflows.
- The flaw is rooted in the logic connecting GitHub workflow YAML configurations to npm package metadata.
-
Exploitation Path: Identity Impersonation
- Attackers align malicious package slugs with existing, vulnerable trusted publishing workflows.
- Forged or captured OIDC tokens permit unauthorized
npm publishactions by spoofing legitimate maintainers. - Malicious payloads are delivered through legitimate-looking version updates to bypass basic integrity checks.
-
Supply Chain Impact: Ecosystem Exposure
- Over 1,500 npm packages are directly susceptible to supply chain takeover.
- Widespread risk of transitive compromise across the JavaScript and Node.js dependency graphs.
- Increased threat surface for AI agents and automated consumers that pull dependencies without manual verification.
-
Mitigation and Remediation: Defensive Posture
- GitHub enforced a 48-hour session expiry for npm Trusted Publishing to limit the hijacking window.
- Organizations must audit CI/CD configurations to eliminate overly broad or hardcoded package slugs.
- Monitor dependency manifests and implement strict version pinning to detect unauthorized version bumps.
-
Strategic Implications: Trust Erosion
- SlugFest highlights systemic weaknesses in OIDC token scoping for package registries.
- Demonstrates the necessity of granular, short-lived credentials in automated software supply chains.
- Underscores the urgent need to re-evaluate trust models in OIDC-based publishing frameworks.
Related posts
- techjacksolutions.com — SlugFest: npm Trusted Publishing Slug Validation Flaw Exposed 1,500+ Packages to Supply Chain Takeover
- Qpulse
- Aviatrix
- Daily
- News4hackers
- Thehackernews
- Safeguard
- Bloom
- Thenextweb