npm Trusted Publishing flaw exposed 1,500+ npm packages to takeover
A flaw in npm's Trusted Publishing let attackers take over packages by registering abandoned GitHub repository names, exposing over 1,500 packages.
Overview
Bloom Security researchers discovered a flaw in npm's Trusted PublishingA package registry feature that lets automated build pipelines publish releases without storing long-lived passwords feature that allowed attackers to take over packages without stealing credentials. The vulnerability existed because npm identified repositoriesA central storage place where a software project's source code, change history, and configuration files are kept by name rather than by a permanent numeric ID, leaving a gap when maintainersThe developer or small team responsible for reviewing changes and publishing releases for an open-source project renamed or deleted their repositories. An attacker could register a new repository with the old name and trick the system into issuing a valid publishing credential. This exposed more than 1,500 npm packagesA reusable web code library published to the public npm registry for developers to install to takeover, with the affected packages accounting for over 10 million total downloads. The risk is high because a malicious update can include a postinstall scriptA short program written in an interpreted language to automate tasks in a browser, shell, or application that runs automatically on every machine that installs the package. GitHub has shipped fixes for the issue, but the exposed packages still average several hundred monthly downloads each.
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.
- maintainer
- 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.
- 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
- script
- A short program written in an interpreted language to automate tasks in a browser, shell, or application. System administrators write scripts to automate daily maintenance, while attackers often use a script to download malware and disable security settings without dropping a compiled file.
- tokens
- 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
- provenance
- The verifiable record of where software, data, or media came from and how it was built. In software supply chain stories, provenance records prove which source repository and build server produced a package so users know it was not swapped by an attacker.
- attestation
- Cryptographic proof from hardware or a build server that a device or package was not tampered with. Before granting access to sensitive data, a server can require hardware attestation from a laptop or confidential cloud machine to verify that its boot code was not altered. Security+ objective 4.6 lists the term
- bug bounty program
- A reward program where a company pays independent researchers who responsibly report security flaws in its systems. Through a bug bounty program, ethical hackers can test a company's websites and apps under clear rules and earn cash rewards for finding bugs before criminals do. Security+ objective 4.3 lists the term
- remediate
- The steps taken to fix a security flaw or clean up a system after a breach. In incident reports, remediation includes installing patches, revoking stolen keys, removing backdoors, and changing configuration settings so the attacker cannot get back in.
- configurations
- A text file that stores settings, network addresses, and options for how a program or server runs. Attackers who gain read access to a server look for its configuration file first because it often contains database passwords, API keys, and internal server paths.
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 Help Net Security website. Cite the article, not this page.
Read the full article on Help Net Security (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
"...npms trusted publishing feature let an attacker push new versions..." Found by reading the article; these exact words are in it - Who is affected: "...npm packages exposed this way..."
Copied word for word from the article - Security+ 2.2 Explain common threat vectors and attack surfaces.
"...npm Trusted Publishing flaw exposed 1,500+ npm packages to takeover..." Found in the headline - Security+ 2.3 Explain various types of vulnerabilities.
"...npm Trusted Publishing flaw exposed 1,500+ npm packages to takeover..." Found in the headline - Security+ 4.6 Given a scenario, implement and maintain identity and access management.
"......of someone else's package without stealing a credential. The attacker only needed to register..." Found in the opening sentences - CYBR 101 week 11: penetration testing, OSINT, MITRE ATT&CK and hacking back
"Bloom Security researchers found that npm's Trusted Publishing feature let..." Found in the opening sentences
How a story is connected to the course, and every objective, week and job role
Same story at other outlets
- Attackers Can Hijack npm Packages Without Stealing Developer Credentials
- 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