Skip to main content
The state of ai impact assessment
Should You Audit Every Dependency or Trust the Publisher?Security Operations & Detection
4 min readFor Enterprise Risk Officers

Should You Audit Every Dependency or Trust the Publisher?

The Core Question

When npm introduced Trusted Publishing in 2023, it aimed to solve a persistent supply-chain issue: long-lived credentials that could be leaked, stolen, or forgotten in CI/CD systems. This mechanism uses OpenID Connect to verify that packages originate from legitimate GitHub Actions workflows, replacing static tokens with short-lived, cryptographically verified credentials.

However, Bloom Security's disclosure of the SlugFest vulnerability exposed a flaw: npm verified the human-readable repository name instead of the permanent numeric repository ID. An attacker could claim an abandoned repository name and gain publishing rights to packages they didn't create. Over 1,500 packages were exposed, with more than 10 million combined downloads.

This incident highlights a key debate: should organizations rely on publisher verification, or does every dependency require independent validation?

Trusting Publisher Mechanisms

Security teams often face resource constraints. Manually auditing every dependency is impractical, especially when enterprise applications might include hundreds of direct dependencies and thousands of transitive ones.

Trusted Publishing addresses a real problem. Static npm tokens have been compromised repeatedly. They linger in environment variables, get committed to repositories, and persist long after the developer who created them has left. Rotating them requires coordination across teams. Short-lived OIDC tokens expire automatically and can't be reused outside their intended workflow context.

Relying on these mechanisms is pragmatic. You're delegating verification to platforms that already manage identity and access. GitHub knows which repository published a release. npm knows which maintainer owns a package. When these systems communicate through OIDC, they create a cryptographic chain of custody stronger than manual processes.

Organizations attempting to verify every dependency independently face diminishing returns. You'll catch obvious typosquatting and known malware, but subtle logic bombs or backdoors require source code review, and you don't have time to review every update. At some point, you're trusting someone's code review process, whether it's yours or the package maintainer's.

The Case for Independent Validation

The counterargument is that automation scales attacks as much as it scales defenses.

Bloom Security found that AI coding agents install about 70 packages per endpoint monthly, rising to around 350 on developer machines. These agents select dependencies based on documentation and popularity metrics, not by verifying publisher identity or reviewing commits. They find a package that seems to solve the problem and install it.

This creates an asymmetry. An attacker who hijacks a single package doesn't need to find developers; they need to be the package an agent chooses. The SlugFest vulnerability allowed repository name reclamation to bypass trust verification, but the underlying risk persists: you're trusting a chain of automated decisions assuming every link is secure.

Independent validation acknowledges this reality. Maintain an approved package list. Run static analysis on new dependencies before they enter production. Monitor for unexpected network connections or file system access during installation hooks. Don't assume publisher verification catches everything, because it often doesn't.

The npm team fixed SlugFest by introducing a 48-hour expiry for unvalidated Trusted Publishing configurations and blocking tokens issued through GitHub Actions' issue_comment events. These controls are helpful but don't eliminate the need for organizations to verify what they're installing.

Practical Approaches

Most security teams operate between these extremes. They don't audit every dependency, but they don't blindly trust publisher mechanisms either.

Common practices include:

  • Tiered verification based on privilege. Packages running in production or handling sensitive data get deeper scrutiny than developer tools running locally. Allocate review capacity to the highest-risk scenarios.

  • Automated policy enforcement. Tools like npm audit, Snyk, or Dependabot flag known vulnerabilities. Organizations add custom rules: block packages with fewer than a set number of downloads, require manual approval for new dependencies, or restrict installations to packages on an internal allowlist.

  • Periodic trust audits. Maintain an inventory of installed packages and periodically verify that maintainers still control their repositories. Audit Trusted Publishing configurations and ensure repository names resolve to repositories under the original maintainer's control.

  • Dependency pinning and private mirrors. Some teams mirror approved package versions internally and pin exact versions in manifests. This limits exposure when a package gets hijacked after you've vetted it.

These approaches don't catch everything but raise the cost and complexity of supply-chain attacks without halting development.

Our Take

Publisher verification is necessary but insufficient. Trusted Publishing solves a credential management problem but not the trust problem.

The SlugFest vulnerability showed that even well-designed verification mechanisms can have implementation gaps. npm's reliance on repository names instead of immutable IDs was a design choice that seemed reasonable until exploited. The fix addresses this flaw but doesn't guarantee future mechanisms won't have their own issues.

Your security posture should assume some dependencies will be compromised. This isn't paranoia; it's probability. With millions of packages, thousands of maintainers, and increasing automation in both development and attack workflows, perfect prevention isn't achievable.

What you can achieve is resilience. Verify publisher identity as a baseline control. Add behavioral monitoring to catch malicious installation hooks. Maintain an audit trail of what's installed and why. Review your dependency tree when threat intelligence suggests a package in your supply chain has been compromised.

The npm team's response to SlugFest demonstrates the right approach: fix the immediate vulnerability, tighten adjacent controls, and advise maintainers to review their configurations. Organizations should apply the same principle. Trust the platform's verification mechanisms as a starting point, but verify that your specific dependencies align with your risk tolerance. Assuming every automated system works perfectly hasn't held up well historically.

Promotional banner highlighting failures found in PCI audits and how to spot the gaps

You Might Also Like