Developers' biggest malware risk is trusted code that attackers hijack

Databricks studied about 5,400 harmful packages on npm, a huge public library of free code. Fakes were common but rarely downloaded, while hijacked trusted packages drew nearly all the downloads.

A grid of dark squares with a scattering of glowing red package icons linked by dotted lines.
Image: Databricks

The short version

  • Databricks' security researchers studied about 5,400 confirmed harmful packages on npm, a huge public library of free, ready-made code. They covered December 2025 to October 2026.
  • Fake packages made by attackers were 89% of the set but drew just 0.2% of its downloads. Genuine packages that attackers took over were only 7%, yet drew over 99%.
  • A new group of attacks now targets the AI tools developers use, stealing the keys to paid AI services and tampering with AI assistants' settings.
Bar charts showing that malware made up most confirmed harmful npm packages in every month from December 2025 to October 2026.
Types of confirmed harmful packages by month. Malware dominates throughout. · Image: Databricks

What the researchers looked at

Modern software is built from parts. Apps use many free, ready-made packages. npm is a huge public library of them for JavaScript, a language used to build websites.

That makes it a target. Attackers publish harmful packages, or they break into the accounts of people who maintain popular ones. When a company's systems download the package, the harmful code comes with it.

Databricks' threat research team studied the harmful npm packages its scanner caught that at least one independent source confirmed. That gave about 5,400 packages over roughly a year.

What they found

The danger is in trusted names. Most harmful packages were fakes that almost nobody installed. In fact, 81% of the fakes had no downloads at all when scanned. The ten most-downloaded harmful packages accounted for over 99% of downloads, and all ten were real packages that had been hijacked.

Attackers moved to the systems that build software. After npm canceled its old, long-lived login keys in December 2025, attackers changed tactics. They broke into the automated systems that build and publish software. Even npm's "trusted" publishing route was abused. Of harmful packages sent that way, 85% were hijacked genuine ones.

AI tools are a new target. Some packages pose as add-ons for AI assistants and steal the passwords on the machine. Others quietly change an AI assistant's settings or instruction files. Some specialize in stealing the keys to paid AI services. The researchers say this target did not exist two years ago.

AI attack kits are spreading through the same library. Ready-made AI hacking kits are now available on npm. The researchers warn they are one install command away from anyone with a motive.

Removal is slow. Public warnings came quickly, a median of 1.7 days for packages not tied to a known campaign. But npm itself usually took about a week to remove them. One in 10 stayed up for over 59 days. Attackers often deleted their own packages first. When checked, 16% were still available to install.

What it means for companies in Indonesia

If your company builds websites or apps, it likely uses npm packages. So do the vendors and agencies who build software for you.

The study's main lesson is uncomfortable. Avoiding obvious fakes is not enough. The biggest risk comes from popular, trusted packages your systems already use, at the moment an attacker takes one over.

The AI finding matters too. The keys and settings for AI coding assistants are now worth stealing. The researchers advise protecting them like passwords.

What to do

  • Ask your developers and software vendors how they check updates to the packages they already use.
  • Set build systems to wait before accepting brand-new package versions, and alert on changes to install scripts.
  • Give build systems short-lived, narrow access, so a hijacked package can't reach your cloud accounts.
  • Protect the settings and keys of AI coding assistants as carefully as any other password.
  • Register your company's name on public code libraries, so attackers can't take it first and pose as you.
  • Plant decoy keys where an attacker would look, so a break-in raises an alarm early.

Sources

  1. 01 · Databricks · 2026-11

Keep reading

  1. Report

    iFood more than doubled its security fixes with one shared AI service

  2. Report

    AI-driven hackers are finding old security gaps in minutes, UK warns

  3. Research

    Most software flaws used in attacks have no public record of their fix