SlugFest: npm Trusted Publishing let anyone claiming an abandoned repo name publish 1,500+ packages
Bloom Security found that npm Trusted Publishing tied packages to a GitHub repository's name rather than its permanent ID, so anyone who registered a renamed or deleted repository's old name could publish new versions. More than 1,500 packages with over 10 million downloads were exposed. Bloom reported it in June; GitHub's fix, shipped October 2, expires unvalidated configurations after 48 hours.
Trusted Publishing, generally available on npm since July 2025, replaces long-lived publishing tokens: a maintainer names the GitHub repository and workflow allowed to publish a package, and a short-lived token from that workflow is exchanged for a publish credential. Bloom Security found that npm stored the repository only by its owner/repo name, at least until a first version was published from it, and ignored the permanent repository and owner IDs that GitHub puts in the token.
Once a bound repository was renamed, transferred or deleted, or its owner account renamed or deleted, the old name became free. Anyone could create a repository with that name, add a workflow file with the matching filename, and publish a new version of someone else's package, without stealing any credential. Bloom ran the attack end to end against an npm scope and GitHub repositories it controlled, then scanned the registry and counted more than 1,500 exposed packages with over 10 million downloads; it says the gap stayed exploitable for four months after it was reported.
Bloom ties the risk to AI coding agents, which it found install around 70 packages a month on a typical endpoint and close to 350 on developer machines, each one a chance for a malicious install script to run. It reported the flaw to GitHub on June 6; GitHub announced its fix on October 2. Unvalidated trusted publishing configurations now expire 48 hours after creation, a configuration is bound to the repository's identity after its first successful publish, and npm now also rejects publishing tokens from GitHub Actions issue_comment events. Bloom says the fix narrows the window rather than checking immutable IDs at configuration time, and advises maintainers to run npm trust list and confirm every listed repository still belongs to them.