RemarkableCloud

Let an AI compare us with your host:

Don't take our word for it. Ask the AI you trust.

Malicious packages outnumber CVEs 9 to 1: the npm and PyPI numbers

RC RemarkableCloud Team 12 min read Articles
On this page
Malicious packages outnumber CVEs 9 to 1: the npm and PyPI numbers
Ask ChatGPT Ask Claude

Sonatype identified 454,648 new malicious open source packages in 2025, and more than 99% of them were on npm. In the same year, the CVE Program published 48,244 CVE records for all software combined. That is more than nine malicious packages for every CVE, and the dependency scanners most teams reach for only check the CVE side.

A malicious package is not a bug in good code. It is malware published on purpose, often as a new version of a package you already trust. Tools like npm audit and pip-audit look up known vulnerabilities, and pip-audit’s own documentation says you must not assume it will defend you against malicious packages. When debug 4.4.2 was hijacked on September 8, 2025, the advisory that gave it a CVE was published seven days later, after npm had already removed the version.

Here are the 2023 to 2026 numbers, the incidents behind them, what npm and PyPI changed, and a checklist for anyone who deploys JavaScript or Python to a server.

How many malicious packages are published each year?

Malicious packages logged by Sonatype per annual report: 245,032 (2023 edition), 512,847 (2024 edition), 454,648 (2025, 2026 edition)

Sonatype reportWindowNew malicious packagesRunning total
2023 edition (October 2023)2023245,032
2024 edition (October 2024)November 2023 to August 2024512,847704,102
2026 edition (January 2026)Calendar year 2025454,6481,233,219
Q3 2026 Malware IndexJuly to September 2026149,3291,960,846

Sonatype tracks malware across npm, PyPI, Maven Central, NuGet and Hugging Face. Its windows changed between editions, so the bars are not perfectly comparable year to year, but the scale is clear: hundreds of thousands of malicious packages a year, and close to 2 million logged in total by September 2026.

Most of that volume is junk rather than targeted attacks. In 2025, 55.9% of logged packages were repository abuse, such as spam floods, and 27.5% were potentially unwanted applications. The share that went after systems was smaller but real: 5.7% exfiltrated host information, 3.9% stole secrets, 2.7% were droppers or loaders and 2.1% were backdoors. One package can carry several labels. In Q3 2026, 27,618 of the 149,329 packages showed at least one overtly malicious behavior, and 74.5% of those were droppers, secret stealers or both.

How does that compare with CVEs?

CVE records published per quarter: 12,009 (Q1 2025), 11,701 (Q2 2025), 11,738 (Q3 2025), 12,796 (Q4 2025), 15,154 (Q1 2026), 20,696 (Q2 2026), 36,962 (Q3 2026)

QuarterCVE records published
Q1 202512,009
Q2 202511,701
Q3 202511,738
Q4 202512,796
Q1 202615,154
Q2 202620,696
Q3 202636,962
Full year 202440,077
Full year 202548,244
January to September 202672,812

CVEs are growing fast too. The CVE Program published 36,962 records in the third quarter of 2026, a 78.6% jump from the quarter before, and it attributes the 2026 increase to AI-driven vulnerability discovery. Those numbers cover every kind of software: operating systems, routers, CMS plugins, everything.

Even so, the 454,648 malicious packages of 2025 were 9.4 times the 48,244 CVE records of the same year. The comparison is not like for like (a CVE describes a flaw, a malicious package is an attack, and much of the malware count is spam), but it shows where the volume is. A security process built only around CVEs covers the smaller pile.

Which ecosystems get hit: npm or PyPI?

npm share of malicious packages logged by Sonatype: over 99% (2025), 75% (Q1 2026), 96.6% (Q2 2026), 89.5% (Q3 2026)

Periodnpm share of malicious packagesOther detail
2025Over 99%
Q1 202675%21,764 packages logged
Q2 202696.6%Non-npm: PyPI 48.5%, NuGet 38.0%, Hugging Face 6.8%, RubyGems 3.0%
Q3 202689.5%133,579 of 149,329 packages

npm dominates by count partly because it is the biggest registry. In 2025 it added 11.18 million releases, more than 60% of all new releases across npm, PyPI, Maven Central and NuGet, by Sonatype’s count. PyPI is the second target: in Q2 2026 it carried 48.5% of the malicious packages found outside npm.

PyPI publishes its own response numbers. In 2025 its team processed more than 2,000 malware reports; 66% were handled within 4 hours and 92% within 24 hours. The same year PyPI received more than 3.9 million new files and 130,000 new projects.

What happened in the big npm and PyPI incidents?

npm downloads from September 1 to 7, 2025 of packages hijacked on September 8: ansi-styles 371.4M, debug 357.6M, chalk 300.0M, supports-color 287.1M, strip-ansi 261.2M, ansi-regex 243.6M, wrap-ansi 198.0M, color-convert 193.5M, 11 more packages 493.5M

Package (hijacked September 8, 2025)npm downloads, September 1 to 7, 2025
ansi-styles371,415,344
debug357,603,707
chalk299,998,281
supports-color287,104,688
strip-ansi261,171,246
ansi-regex243,643,338
wrap-ansi197,993,431
color-convert193,536,705
11 more packages493,465,493
Total, 19 packages2,705,932,233

The big incidents share one pattern: attackers take over a trusted maintainer or a publishing token and push a poisoned version of a real package. Nobody has to make a typo to get hit.

DateIncident
September 8, 2025A maintainer’s npm account is taken over in a phishing attack, and poisoned versions of debug, chalk and related packages are published. debug 4.4.2 tries to redirect cryptocurrency transactions in browsers. npm removes it the same day.
September 14, 2025GitHub is notified of Shai-Hulud, a self-replicating worm that steals tokens and cloud keys and publishes itself into the victim’s other packages. GitHub removes more than 500 compromised packages.
September 15, 2025The GitHub advisory for debug 4.4.2, aliased CVE-2025-59144, is published: seven days after the hijack.
November 24, 2025A second wave, “Sha1-Hulud: The Second Coming”, hits npm. PyPI later reports that it was not exploited but revoked PyPI tokens found in compromised repositories.
March 31, 2026Malicious axios 1.14.1 and 0.30.4 are published from 00:21 UTC and removed at 03:15 UTC. The lead maintainer’s PC had been compromised through social engineering. axios had 100,340,121 downloads the week before.
April 2, 2026PyPI reports the LiteLLM and Telnyx compromise, which started with an exposed API token. Malicious litellm versions were live 2 hours 32 minutes and downloaded more than 119,000 times.
August 2026A “Mini Shai-Hulud” wave on npm; Sonatype tracks 2,225 affected component versions.

The 2.7 billion figure in the chart counts downloads of all versions of those 19 packages, not of the bad ones, which were live for hours. It shows how far a hijacked version can reach in that time. A server that ran a fresh install during the window got the malware; one that installed from a lockfile written the week before did not.

What npm and PyPI changed

After Shai-Hulud, GitHub set out its plan on September 22, 2025 and has delivered most of it:

  • November 5, 2025: new npm classic tokens can no longer be created; granular write tokens are capped at 90 days.
  • December 9, 2025: all classic tokens are permanently revoked. npm login now issues two-hour session tokens, and 2FA is on by default for new packages.
  • July 8, 2026: npm 12 is released and tagged latest. It no longer runs preinstall, install or postinstall scripts from dependencies (or implicit native builds) unless the project allows them, and it refuses Git and remote URL dependencies unless allowed.
  • Around January 2027 (expected): tokens that bypass 2FA lose direct publishing; a publish needs human 2FA approval or trusted publishing.

Trusted publishing lets a CI workflow publish with short-lived credentials instead of a stored token. PyPI introduced it in April 2023 and npm in July 2025. By the end of 2025, more than 50,000 PyPI projects used it, more than 20% of uploads came through it, and 17% of uploads carried an attestation. More than 52% of active PyPI users had phishing-resistant 2FA.

What this means if you run a site or a server

If your server builds a Node or Python app, the risk sits in the install step, not in your code:

  • A clean CVE scan means little here. A fresh malicious version is not in a vulnerability database when you install it. debug’s CVE advisory came a week after the hijack, when npm had already pulled the version.
  • The install step runs code. Sonatype notes that open source malware executes at install time, so downloading the package is enough to become a victim. On npm 11 and older, install scripts run by default.
  • Where the install runs decides what leaks. Shai-Hulud harvested GitHub tokens and AWS, Google Cloud and Azure keys from the machine it ran on. On a production server, that means production secrets.
  • A lockfile is your time machine. CISA’s Shai-Hulud advice was to pin dependencies to releases from before September 16, 2025. You can only do that if you know exactly what you installed.

A supply chain checklist for your server

1. Install from the lockfile, every time. npm ci requires a package-lock.json, fails if it disagrees with package.json, and never rewrites either file.

git ls-files package-lock.json
npm ci

2. Verify registry signatures after installing. This needs npm 8.15.0 or newer and also checks provenance attestations.

npm audit signatures

3. Control install scripts. On npm 12, scripts from dependencies are off until you approve them; review the list and commit the allowlist in package.json. On npm 11 or older, turn scripts off yourself. Caveats: packages that compile native code or download binaries in an install script will break until you allow them, and with ignore-scripts on, your own pre and post scripts stop running too.

npm --version
npm approve-scripts --allow-scripts-pending   # npm 12
npm config set ignore-scripts true            # npm 11 and older

4. Pin exact versions and wait a few days on new ones. npm 12 documents a min-release-age setting in days, which skips versions younger than that. The malicious axios and litellm versions above were pulled within hours, so a cooldown of a few days skips that kind of attack. Install security fixes deliberately when you need them.

npm config set save-exact true
npm config set min-release-age 3

5. For Python, install only hashed, pinned requirements. Hash-checking mode is all or nothing: every package, including dependencies, needs a pinned version and a hash. pip also recommends refusing source builds.

pip-compile --generate-hashes requirements.in
pip install --require-hashes --only-binary :all: -r requirements.txt

6. Scan for known vulnerabilities too. pip-audit covers the CVE side. It does not replace steps 1 to 5.

pip-audit -r requirements.txt --require-hashes
npm audit --audit-level=high

7. Check what a deploy actually installed. Look at what changed in the lockfile and whether a package from an advisory is present.

git diff HEAD~1 -- package-lock.json | grep '"version"'
npm ls debug chalk axios
pip freeze | grep -i litellm

8. Keep publishing tokens off the production server. If an install ever runs malicious code there, long-lived tokens are the first thing it takes.

grep -n "_authToken" ~/.npmrc 2>/dev/null
ls -l ~/.pypirc 2>/dev/null

9. Build somewhere else. Run npm ci and the build on a CI runner or a separate build server, then ship the built files. Production needs the result, not the package manager.

How RemarkableCloud handles it

Every server we sell is fully managed at no extra cost, and we configure and support everything we install on it. Our patching process covers reported vulnerabilities: agents detect them and measure which servers are exposed, we apply preventive measures before a patch exists, and we test patches on a dev box and canary servers before deploying them. Patching covers published CVEs, not the packages your own deploys pull in, so the checks above apply on any server.

The managed firewall and intrusion detection on each server are fed by centralized log analysis and live threat data. Every server gets a daily snapshot, and you can take extra snapshots for free, for example right before a deploy that updates dependencies.

If you want to move builds off your production server, or have us look at how your deploys install packages, open a ticket. See how our managed VPS works, app hosting for Node and Python or developer servers, and read how fast attackers exploit new flaws for the CVE side of the story.

Methodology

  • Sonatype annual reports: counts of malicious packages identified by automated detection and expert review, with duplicates and variants normalized. The 2023 figure is from the October 3, 2023 press release; the 2024 figure covers November 2023 to the time of writing in August 2024; the 2026 edition (released January 28, 2026) covers calendar 2025. Earlier running totals are counted “since 2019”; the 2026 quarterly indexes count “since 2017”, so the totals are not one continuous series. Sonatype sells supply chain security products.
  • Sonatype quarterly indexes: Q1 (April 14, 2026), Q2 (July 9, 2026) and Q3 (October 8, 2026). The Q2 index gives shares but no quarterly total, so we do not chart a Q2 count.
  • CVE records: quarterly counts of records published by all CNAs, from the CVE Program’s quarterly reports for Q4 2024, Q4 2025 and Q3 2026 (published November 17, 2026). The Q3 2026 report revised Q1 2026 from 15,176 to 15,154 and Q2 from 20,709 to 20,696; we use the revised numbers. Yearly totals are our sums of the quarters.
  • Ratio: 454,648 divided by 48,244 is 9.4. The two counts measure different things and come from different organizations.
  • Downloads: npm’s public downloads API, read November 29, 2026, for September 1 to 7, 2025 (the week before the hijack) and March 23 to 29, 2026 for axios. Counts include all versions. The 19 packages are those on Sonatype’s list of hijacked packages with chalk, debug and their related utilities; the other nine on that list (duckdb, prebid and smaller packages) are left out.
  • Incident dates: the GitHub advisory for debug (via OSV), GitHub’s September 22, 2025 post, CISA’s alert of September 23, 2025, Sonatype’s 2026 report and Q3 2026 index, the oss-security post of April 8, 2026 quoting the axios maintainers’ timeline, and PyPI’s posts of November 26, 2025 and April 2, 2026.
  • Tool behavior: npm 12 documentation for npm ci, npm install and npm audit, npm’s registry signatures page, pip’s secure installs page and the pip-audit project page, all read November 29, 2026.

Questions and answers

How many malicious open source packages were published in 2025?

Sonatype identified 454,648 new malicious packages in 2025, and over 99% of them were on npm. Its running total reached 1,233,219 by the end of 2025.

Does npm audit or pip-audit catch malicious packages?

Not reliably. Both look up known vulnerabilities, and pip-audit's documentation says you must not assume it will defend you against malicious packages. The GitHub advisory that gave debug 4.4.2 a CVE was published seven days after the September 8, 2025 takeover.

How many CVEs were published in 2025?

The CVE Program published 48,244 CVE records in 2025, for all software combined, up from 40,077 in 2024. In the first nine months of 2026 it published 72,812, including 36,962 in the third quarter alone.

Does npm still run install scripts by default?

Not since npm 12, released on July 8, 2026. It no longer runs preinstall, install or postinstall scripts from dependencies unless the project allows them. npm 11 and older still run them unless you turn on ignore-scripts.

Should I run npm install on my production server?

Better not. Shai-Hulud stole tokens and cloud keys from the machines where it ran, so build on a separate machine with npm ci and a committed lockfile, and ship the built result to production.

Sources and references

  1. Sonatype, 2026 State of the Software Supply Chain: Open Source Malware at the Gate · sonatype.com
  2. Sonatype, 2026 State of the Software Supply Chain (PDF) · sonatype.com
  3. Sonatype, 10th Annual State of the Software Supply Chain, 2024 (PDF) · sonatype.com
  4. Sonatype, 9th Annual State of the Software Supply Chain press release (2023) · sonatype.com
  5. Sonatype, Q1 2026 Open Source Malware Index · sonatype.com
  6. Sonatype, Q2 2026 Open Source Malware Index · sonatype.com
  7. Sonatype, Q3 2026 Open Source Malware Index · sonatype.com
  8. Sonatype, npm chalk and debug packages hit in supply chain attack · sonatype.com
  9. CVE Program Report for Q4 2025 · cve.org
  10. CVE Program, metrics (published CVE records by quarter) · cve.org
  11. GitHub Advisory GHSA-4x49-vf9v-38px (debug 4.4.2), via OSV · osv.dev
  12. npm downloads API, debug, September 1 to 7, 2025 · api.npmjs.org
  13. GitHub, Our plan for a more secure npm supply chain · github.blog
  14. CISA, Widespread Supply Chain Compromise Impacting npm Ecosystem · cisa.gov
  15. GitHub changelog, classic token creation disabled (November 5, 2025) · github.blog
  16. GitHub changelog, classic tokens revoked (December 9, 2025) · github.blog
  17. GitHub changelog, upcoming breaking changes for npm v12 · github.blog
  18. GitHub changelog, npm install-time security (July 2026) · github.blog
  19. oss-security, axios 1.14.1 and 0.30.4 compromise · openwall.com
  20. npm downloads API, axios, March 23 to 29, 2026 · api.npmjs.org
  21. PyPI, 2025: A Year in Review · blog.pypi.org
  22. PyPI, Trusted Publishing is popular · blog.pypi.org
  23. PyPI and Shai-Hulud · blog.pypi.org
  24. PyPI, incident report: LiteLLM and Telnyx supply chain attack · blog.pypi.org
  25. npm ci (npm 12 documentation) · docs.npmjs.com
  26. npm install (npm 12 documentation) · docs.npmjs.com
  27. npm audit (npm 12 documentation) · docs.npmjs.com
  28. npm, verifying registry signatures · docs.npmjs.com
  29. pip, secure installs · pip.pypa.io
  30. pip-audit on PyPI · pypi.org

Your server runs. You sleep.

Fully managed hosting from people who have been doing this since 2001.