- Bloom Security found a flaw in npm Trusted Publishing that could let attackers reclaim GitHub repository slugs and publish to existing packages without stealing credentials.
- More than 1,500 npm packages configured for Trusted Publishing were exposed, with over 10 million combined downloads and more than 1 million monthly downloads.
- AI coding agents can install roughly 70 packages per month on an average endpoint and up to 350 on developer machines, increasing the chance of malicious code entering environments.
- npm fixed the issue after more than 120 days, adding a 48-hour expiry for unvalidated configurations; maintainers should audit and recreate trust bindings.
Security researchers at Bloom Security have detailed a flaw in npm Trusted Publishing that could have let an attacker publish a new release of an existing package without taking over a maintainer account. The company says the issue has now been fixed, and researcher Golan Myers told CSO that npm confirmed a remediation shipped on October 2. According to Myers, the patch adds a 48-hour expiry for unvalidated Trusted Publishing configurations. Bloom says it has not seen active exploitation in the wild, though its team did reproduce the attack in controlled testing and published a new version of an existing npm package.
The investigation, called SlugFest, looked at how automated software publishing and AI-driven package installation can collide with weak trust assumptions. Bloom identified more than 1,500 npm packages that were exposed to a publishing attack tied to GitHub repository addresses. Those packages had been downloaded more than 10 million times in total, the researchers said, and they accounted for over one million downloads each month. The figures apply to packages configured for Trusted Publishing, not the entire npm registry.
How the Trusted Publishing trust model failed
npm Trusted Publishing was designed to reduce the need for long-lived publishing tokens. Instead of storing a permanent secret, a GitHub Actions workflow can request a short-lived OpenID Connect token, exchange it with npm, and receive a temporary credential for a release. That approach limits the chance that a static token leaks through logs or build systems. Bloom found, however, that npm initially tied the trust relationship to a human-readable GitHub repository slug such as owner/repository, rather than immediately binding it to GitHub’s permanent repository ID.
That difference matters when a repository is renamed, moved, or deleted. The old address can become available for someone else to claim. If a package’s Trusted Publisher binding still points to that old slug and the repository has not yet produced a successful publish, a different repository could potentially satisfy the original trust setup. According to Bloom, this created a path to publishing access without stealing credentials from the legitimate maintainer, compromising their npm account, or breaking into their GitHub account.
AI agents make the exposure harder to manage
Bloom also studied how AI coding agents change the software supply chain. The company observed millions of agents across dozens of organizations. On a typical endpoint, it found that AI agents install about 70 packages per month. On developer machines, that number can approach 350 monthly installs. Those totals cover direct installations only and do not include the extra dependencies those packages pull in, so the real software footprint can be larger.
Individual agents installed between 0.3 and 1.2 packages per day, depending on the agent type, according to the research. Developer machines saw two to three direct package installations daily. A normal endpoint ran three agents across command-line interfaces, integrated development environments, extensions, and assistants. Developer machines could run five or more. That activity gives untrusted code more opportunities to enter an environment, especially because packages may execute installation scripts, including postinstall hooks, before a developer reviews every dependency.
Bloom said it caught and blocked a customer’s AI agent trying to install one of the packages affected by the vulnerability. The incident showed how the research could intersect with real-world automated development. Because AI agents often select, install, and execute code on behalf of users, a malicious package in AI assistants no longer needs to convince a person to download it manually. If an agent resolves it as a dependency, the code may land in a developer system or continuous integration pipeline with limited human oversight.
From a reclaimed slug to a malicious package release
To demonstrate the issue, Bloom used researcher-controlled GitHub repositories and an npm package under a researcher-owned scope. The team successfully published to the package from a second repository that belonged to another organization. The shared element was the repository slug, which had become available for reclamation. Once an attacker gains publishing access, they can release a malicious version under the legitimate package name. Existing download counts, reputation, and dependency relationships remain attached to that name.
Distribution can then happen through normal automation. AI agents may resolve dependencies and install the latest available versions without anyone reviewing each package’s origin or release history. If the malicious release includes a postinstall hook, its code can run during installation on developer machines or CI systems. The risk can also reach downstream projects: a compromised package used by other software can open a path for malicious code to enter additional environments. Bloom also pointed to a possible blind spot in provenance checks. A malicious release can carry an attestation tied to the attacker’s own repository, and some systems only verify that an attestation exists instead of checking whether its source matches the expected maintainer repository.
Scope, disclosure timeline, and the eventual fix
A registry-wide scan by Bloom found more than 1,500 vulnerable packages. Together, they had over 10 million total downloads and more than one million downloads per month. The researchers stressed that these numbers refer to the subset of npm packages configured for Trusted Publishing. The flaw remained exploitable for more than 120 days after disclosure, according to Bloom. The company reported it through GitHub’s HackerOne program on June 6, 2026. GitHub triaged and validated the report on June 9, and the last response before the eventual fix came on July 8.
After six additional enquiries, including a mediation request, Bloom prepared to publish its findings. Before going public, it sent the research to npm and repeated the attack test. At that point, the team discovered that npm had implemented a fix. npm later confirmed the remediation and apologized for the delayed communication. Bloom’s proposed solution was to store immutable repository and owner identifiers when trust is established, then verify the repository identifier in the OIDC token during publishing authorization. The researchers noted that PyPI’s Warehouse already follows this approach and that the issue also affected npm’s GitLab Trusted Publishing implementation.
What maintainers and security teams should do
Package maintainers should review their publishing permissions rather than assume the platform fix solves every leftover problem. Bloom recommends running npm trust list and checking that every configured repository address still resolves to a repository under their control. If a bound repository has been renamed or transferred, the trust binding should be removed and recreated with the current address. If a repository is deleted, any associated trust configuration should be removed when it is no longer needed.
Security leaders have a broader job as well. Bloom advises auditing installed software beyond traditional packages, including extensions, applications, plugins, repositories, MCPs, and skills. Organizations should also enforce a supply-chain firewall to control what enters enterprise environments and set policies that let employees use AI agents securely. Monitoring for unexpected package releases can help catch suspicious activity, but managing npm packages and dependency inventories alone may not provide enough protection when automated tools are constantly installing code.
For package owners and enterprise defenders, the core lesson is not that automated publishing or AI coding tools are inherently unsafe. The research shows how a broken trust relationship can be magnified when software creation and installation become more autonomous. Systems that publish and install code need to verify not only what a source is called, but whether it is the source they actually meant to trust. A trusted name, as Bloom puts it, is not always a trusted identity.
