Attackers Can Hijack npm Packages Without Stealing Developer Credentials
A flaw in npm's Trusted Publishing mechanism allows attackers to publish malicious updates to legitimate packages without stealing developer credentials.
Overview
Researchers found a flaw in npm's Trusted PublishingA package registry feature that lets automated build pipelines publish releases without storing long-lived passwords system that allows attackers to publish malicious updates to legitimate packages without stealing developer credentialsThe login details, such as a username and password or key, that prove who an account belongs to. This vulnerability affects more than 1,500 packages that have over 10 million combined downloads. The issue arises because the system initially relied on a GitHub repositoryA central storage place where a software project's source code, change history, and configuration files are kept slug, which is not permanent and can be reclaimed by an attacker after a repository is renamed or deleted. An attacker can claim this abandoned path, obtain a valid publishing credential, and release a malicious version under the victim package's legitimate name. This is particularly concerning because AI coding agents increasingly select and install dependencies autonomously, meaning a malicious release can execute code without needing to persuade a human developer. The impact extends to developers, CI systems, and automated tools that execute the installation command.
Terms in this story
- Trusted Publishing
- A package registry feature that lets automated build pipelines publish releases without storing long-lived passwords. Public registries encourage maintainers to switch to trusted publishing so a stolen developer laptop does not contain permanent tokens that could push malicious updates.
- Credentials
- The login details, such as a username and password or key, that prove who an account belongs to. Many breaches begin when attackers steal an employee's login credentials through a fake website and sign in to the company network as if they belonged there. Security+ objective 4.6 lists the term
- repository
- A central storage place where a software project's source code, change history, and configuration files are kept. Software teams collaborate by pushing code to a shared repository, and attackers scan public repositories for accidentally committed API keys or try to poison popular projects.
- npm Packages
- A reusable web code library published to the public npm registry for developers to install. Web developers pull in dozens of npm packages when building a site, and attackers frequently publish malicious packages with lookalike names to steal developer credentials during installation. Security+ objective 2.2 lists the term
- token
- A short-lived digital pass that a server gives a logged-in user or app. After you sign in once, your browser or app presents a token on each request, and if malware steals that token the attacker can act as you without knowing your password. Security+ objective 4.6 lists the term
- registry
- A central database of system settings on a computer or a public catalog that hosts software packages. In security news, the registry means either the operating system settings database where malware adds startup entries or a public package registry where developers download code libraries.
- CI/CD pipelines
- The automated pipeline that tests, builds, and deploys software whenever developers push new code. Attackers love to compromise a company's CI/CD pipeline because that build server holds cloud keys and can inject malicious code directly into official software releases. Security+ objective 4.7 lists the term
- OpenID Connect
- An identity layer on top of OAuth that lets websites verify who a user is. When you use a single sign-on button on a website, OpenID Connect provides a signed token telling the application your verified email address and user ID.
- OIDC
- An identity layer built on OAuth that lets apps verify user logins through a central provider. Many single sign-on portals use OIDC to issue a signed identity token confirming who just logged in and what email address they hold.
- secrets
- Private credentials used by software, such as API keys, database passwords, and encryption keys. Software teams use vault tools to keep secrets out of source code because anyone who finds a leaked secret in a public repository can log right in to the company's cloud services.
- logs
- Timestamped records that servers and apps write whenever someone signs in, changes a setting, or makes a request. During an investigation, responders examine security logs to trace when an attacker first logged in and which internal machines they accessed. Security+ objective 4.4 lists the term
- maintainer's
- The developer or small team responsible for reviewing changes and publishing releases for an open-source project. Supply chain attackers often target a volunteer maintainer with phishing emails or offers to help, hoping to gain publishing rights over a popular code library.
This page is a short description made for this site. The article itself, with its author's name and its own link, is on the GBHackers website. Cite the article, not this page.
Read the full article on GBHackers (opens in a new tab)
Course connections
Each line below connects this story to a Security+ objective (a skill on CompTIA's Security+ exam, a common first cybersecurity certification), a CYBR 101 week, or a cybersecurity job, and quotes the words that made the connection.
- Kind of story: Vulnerability and patch
"...a flaw in npms trusted publishing mechanism..." Found by reading the article; these exact words are in it - Security+ 2.2 Explain common threat vectors and attack surfaces.
"Attackers Can Hijack npm Packages Without Stealing Developer Credentials..." Found in the headline - Security+ 2.3 Explain various types of vulnerabilities.
"A flaw in npm's Trusted Publishing mechanism could let..." Found in the opening sentences - Security+ 4.6 Given a scenario, implement and maintain identity and access management.
"......Can Hijack npm Packages Without Stealing Developer Credentials..." Found in the headline - Job skill (from the U.S. Department of Defense list of cybersecurity jobs): Knowledge of threats to OPSEC when installing, using, modifying, and uninstalling tools.
"Attackers Can Hijack npm Packages Without Stealing Developer Credentials..." Found by reading the article; these exact words are in it
How a story is connected to the course, and every objective, week and job role
Same story at other outlets
- npm Trusted Publishing Flaw With 10 Million Downloads Exposes 1,500+ Packages to Malicious Takeover
- Over 1,500 npm packages exposed by Trusted Publishing validation flaw
- npm Trusted Publishing flaw exposed 1,500+ npm packages to takeover