Security researchers uncovered a weakness in npm Trusted Publishing that could let attackers publish malicious releases without stealing maintainer credentials.
Named SlugFest, the issue affected more than 1,500 packages with over 10 million total downloads and more than one million monthly downloads, according to the researchers.
The vulnerability involved how npm linked publishing permissions to GitHub repositories. Before a repository completed its first trusted publish, npm relied on its readable owner/repository address, known as a slug, rather than its permanent numeric identity.
If that address became available after a repository rename, transfer, or deletion, an attacker could reclaim it and potentially inherit publishing access to the associated npm package.
Bloom reported the issue on June 6, 2026. GitHub validated it on June 9, according to the disclosure. A mitigation announced on October 2 introduced automatic expiration for unused trusted publishing configurations, roughly four months after the initial report.github
npm Flaw Enables Takeovers
Trusted Publishing replaces long lived automation secrets with short lived credentials obtained through OpenID Connect, or OIDC. A GitHub Actions workflow requests an identity token and exchanges it with npm for permission to publish.
The weakness appeared during initial trust setup. According to Bloom, npm stored the repository slug, workflow filename, and optional environment name.
It did not bind the configuration to GitHub’s immutable repository and owner identifiers until the first successful publication.
An attacker could create a repository at an abandoned trusted slug and add a workflow with the expected filename. GitHub would issue an OIDC token identifying the attacker’s repository, including its new numeric identifier.
Because npm initially checked the matching slug and workflow without an established numeric identity, the exchange could return a valid publishing credential.
Bloom demonstrated the attack using researcher controlled packages and repositories belonging to different organizations. The shared slug enabled publication without compromising the legitimate maintainer’s npm or GitHub account.
A malicious release could retain the package’s familiar name and reach existing users. Installation scripts could execute attacker controlled code where lifecycle scripts were enabled.
Provenance checks that only confirmed a signature, without checking the expected source repository, could also miss the ownership change.
Bloom’s enterprise observations suggest autonomous coding tools expand this exposure. Researchers reported about 70 direct agent installed packages per typical endpoint each month, rising to approximately 350 on developer machines. These figures exclude dependencies pulled in indirectly.
Agents selecting dependencies can therefore distribute compromised releases without a developer manually choosing each package.
However, the research describes potential exploitation and a controlled demonstration, not confirmed malicious takeovers across all identified packages.
GitHub’s mitigation expires unvalidated configurations after 48 hours. A successful first publication validates the configuration and exempts it from expiration. Changing the repository or project identity requires a new trust relationship.
Join 16,000+ SOC teams using ANY.RUN to streamline threat investigations and reduce manual effort. Explore for your team