5,400 Malicious npm Packages: Hijacked Popular Ones Are 7% of the Set and Over 99% of the Downloads

A Databricks analysis of roughly 5,400 malicious npm packages published between December 2025 and October 2026 finds that compromised legitimate packages make up about 7% of the set but account for more than 99% of recorded downloads. It also documents a class aimed at AI developer tooling, including MCP server packages that harvest credentials.

4 min readIntermediate

Executive summary. Databricks published an analysis of about 5,400 confirmed malicious npm packages released between December 2025 and October 2026. The headline result reframes how to think about supply-chain risk: compromised legitimate packages are only about 7% of the malicious set, but they account for more than 99% of the recorded download exposure. In other words, most malicious packages are throwaways that almost nobody installs, while the few that are hijacked updates to trusted names reach almost everyone who is affected. The study also reports that 72% of packages show signs of code concealment, 30% download a second component after install, that attackers' interest in npm authentication tokens peaked at 22% of packages in March and fell below 5% from May, and that a distinct class now targets AI development tooling, including MCP server packages that harvest credentials from the agent host. The practical lesson: typosquat hygiene matters, but the dollar risk sits in the update you trust. This is a separate matter from the alleged TeamPCP/Databricks incident reported earlier in the year, which Databricks said it investigated and found nothing.

Malicious npm packages: count vs exposure

What the data says

Finding Number
Malicious packages analysed About 5,400 (Dec 2025 to Oct 2026)
Compromised legitimate packages About 7% of the set
Share of recorded downloads from those Over 99%
Packages showing code concealment 72%
Packages that fetch another component 30%
npm-token targeting Peaked at 22% (March), below 5% from May
New class Malware aimed at AI dev tools, including MCP server packages harvesting credentials

Treat these as the authors' figures from one dataset; the percentages depend on how Databricks defined and counted packages.

Why it matters

Two very different risks hide inside the headline "5,400".

  • The long tail (about 93% of packages) is typosquats, lookalikes and throwaways. They are numerous, easy to automate and mostly low impact, because nobody installs them. They are still how developers get hit by a careless npm install of a mistyped name.
  • The short head (about 7%) is legitimate packages whose maintainers' accounts or release pipelines were taken over. They carry real trust and real traffic, and a malicious version flows into builds through normal, automatic updates. This is the pattern behind this week's agent-framework hijack on PyPI and Optimizely's client-side script injection, in different ecosystems.

The AI tooling finding is the new part: MCP servers and agent plug-ins run on the machine that holds your keys, are installed quickly from public registries, and are rarely reviewed. That is an ideal place for a credential stealer.

What to do

  1. Lock and verify. Commit lockfiles and install with npm ci, so builds use exactly the versions you reviewed.
  2. Slow down new releases. Some package managers can delay very new versions (for example pnpm's minimumReleaseAge); check your tool's documentation. A few days' delay lets the community catch most hijacks before you pull them.
  3. Neutralise install scripts where you can. npm config set ignore-scripts true blocks a whole class of install-time execution; allow-list the packages that truly need scripts. It is not a complete defence, since runtime code can still be malicious.
  4. Treat MCP servers and agent plug-ins as code you run with your credentials. Pin versions, read what they ask for, and run them under a low-privilege account or container without your cloud keys.
  5. Protect your own publishing. Use npm trusted publishing (OIDC) with provenance, enforce phishing-resistant MFA on maintainer accounts, and limit who can publish.
  6. Keep secrets out of reach of installs: short-lived credentials, no long-lived tokens in build environments, egress filtering on CI.
  7. Monitor. Software composition analysis and a malicious-package feed in CI, plus alerts on new lifecycle scripts appearing in a dependency update.

How to detect it

  • New or changed preinstall/postinstall scripts in a dependency diff (npm diff between versions, or lockfile review).
  • Obfuscated or minified code in a package that was previously readable.
  • Unexpected network calls during install or first run, particularly to paste services, webhooks or raw IPs.
  • A dependency update that adds a new transitive dependency or a version published unusually soon after another.
  • Credential use from new IPs soon after a build or developer install.

Conclusion

The data confirms what incident responders keep seeing: volume and impact are different axes. Thousands of malicious packages are noise; a handful of hijacked, trusted ones are the incidents. Spend your effort on controlling what updates you accept, what code can run at install time, and what secrets an install can reach, and treat AI tooling as a first-class part of that attack surface.

Do this now: commit lockfiles and switch CI to npm ci, turn on a release-age delay and ignore-scripts where practical, and review which MCP servers and agent plug-ins run on machines that hold credentials.

Related: our analysis of an abandoned dependency risk and the Learn track on web application pentesting.

Sources: Databricks, EconoTimes summary, Cybersecurity News on the separate TeamPCP claim. Figures are the study authors' and were reported through secondary coverage; read the Databricks post for the methodology.

HackersRoot Research · Research team

The HackersRoot research team investigates attack techniques across AI systems, cloud and identity, and enterprise networks, then publishes the detections and hardening guidance that stop them.

More from HackersRoot →

Related research

AppSec & Supply Chain

Five Breaches in Five Days: Microsoft Entra, Bell Canada, Samsung Securities, GoFundMe and Tower Records Japan

A roundup of five breaches disclosed or detailed in the last few days: Microsoft's Entra Connect Health API, a Bell Canada intrusion by what the company calls an 'agentic' actor, Samsung Securities' complaint system, GoFundMe Pro's API, and Tower Records Japan's online store. What each company confirmed, what is still unknown, and the steps affected people and defenders should take.

AppSec & Supply Chain

Idunno.AntiCsrf CVE-2026-131914: The ASP.NET Anti-CSRF Library That Deserializes Its Way to RCE

Mandiant reports active exploitation of CVE-2026-131914, a CVSS 9.3 insecure-deserialization flaw in Idunno.AntiCsrf, a legacy third-party anti-CSRF library used by older ASP.NET WebForms apps. A single unauthenticated request can run code in the IIS worker process. ASP.NET itself isn't the problem; the dependency is. The fix is to stop using the library, and rotating machine keys won't help.

AppSec & Supply Chain

N-able Mail Assure CVE-2026-134624: The SSRF Found While Investigating a Breach of Its Own Cloud

N-able disclosed CVE-2026-134624, a critical server-side request forgery (CVSS 4.0 9.3) in Mail Assure and SpamExperts, discovered while investigating a cyberattack on one hosted server. The connection check for LDAP synchronisation accepted any destination, so an attacker with high-privilege API access could probe internal hosts. The fix is build 20261121.1943.