Malicious packages outnumber CVEs 9 to 1: the npm and PyPI numbers
On this page
- How many malicious packages are published each year?
- How does that compare with CVEs?
- Which ecosystems get hit: npm or PyPI?
- What happened in the big npm and PyPI incidents?
- What npm and PyPI changed
- What this means if you run a site or a server
- A supply chain checklist for your server
- How RemarkableCloud handles it
- Methodology
- Questions and answers
- Sources and references
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?

| Sonatype report | Window | New malicious packages | Running total |
|---|---|---|---|
| 2023 edition (October 2023) | 2023 | 245,032 | |
| 2024 edition (October 2024) | November 2023 to August 2024 | 512,847 | 704,102 |
| 2026 edition (January 2026) | Calendar year 2025 | 454,648 | 1,233,219 |
| Q3 2026 Malware Index | July to September 2026 | 149,329 | 1,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?

| Quarter | CVE records published |
|---|---|
| Q1 2025 | 12,009 |
| Q2 2025 | 11,701 |
| Q3 2025 | 11,738 |
| Q4 2025 | 12,796 |
| Q1 2026 | 15,154 |
| Q2 2026 | 20,696 |
| Q3 2026 | 36,962 |
| Full year 2024 | 40,077 |
| Full year 2025 | 48,244 |
| January to September 2026 | 72,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?

| Period | npm share of malicious packages | Other detail |
|---|---|---|
| 2025 | Over 99% | |
| Q1 2026 | 75% | 21,764 packages logged |
| Q2 2026 | 96.6% | Non-npm: PyPI 48.5%, NuGet 38.0%, Hugging Face 6.8%, RubyGems 3.0% |
| Q3 2026 | 89.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?

| Package (hijacked September 8, 2025) | npm downloads, September 1 to 7, 2025 |
|---|---|
| ansi-styles | 371,415,344 |
| debug | 357,603,707 |
| chalk | 299,998,281 |
| supports-color | 287,104,688 |
| strip-ansi | 261,171,246 |
| ansi-regex | 243,643,338 |
| wrap-ansi | 197,993,431 |
| color-convert | 193,536,705 |
| 11 more packages | 493,465,493 |
| Total, 19 packages | 2,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.
| Date | Incident |
|---|---|
| September 8, 2025 | A 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, 2025 | GitHub 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, 2025 | The GitHub advisory for debug 4.4.2, aliased CVE-2025-59144, is published: seven days after the hijack. |
| November 24, 2025 | A 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, 2026 | Malicious 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, 2026 | PyPI 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 2026 | A “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 loginnow 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
- Sonatype, 2026 State of the Software Supply Chain: Open Source Malware at the Gate · sonatype.com
- Sonatype, 2026 State of the Software Supply Chain (PDF) · sonatype.com
- Sonatype, 10th Annual State of the Software Supply Chain, 2024 (PDF) · sonatype.com
- Sonatype, 9th Annual State of the Software Supply Chain press release (2023) · sonatype.com
- Sonatype, Q1 2026 Open Source Malware Index · sonatype.com
- Sonatype, Q2 2026 Open Source Malware Index · sonatype.com
- Sonatype, Q3 2026 Open Source Malware Index · sonatype.com
- Sonatype, npm chalk and debug packages hit in supply chain attack · sonatype.com
- CVE Program Report for Q4 2025 · cve.org
- CVE Program, metrics (published CVE records by quarter) · cve.org
- GitHub Advisory GHSA-4x49-vf9v-38px (debug 4.4.2), via OSV · osv.dev
- npm downloads API, debug, September 1 to 7, 2025 · api.npmjs.org
- GitHub, Our plan for a more secure npm supply chain · github.blog
- CISA, Widespread Supply Chain Compromise Impacting npm Ecosystem · cisa.gov
- GitHub changelog, classic token creation disabled (November 5, 2025) · github.blog
- GitHub changelog, classic tokens revoked (December 9, 2025) · github.blog
- GitHub changelog, upcoming breaking changes for npm v12 · github.blog
- GitHub changelog, npm install-time security (July 2026) · github.blog
- oss-security, axios 1.14.1 and 0.30.4 compromise · openwall.com
- npm downloads API, axios, March 23 to 29, 2026 · api.npmjs.org
- PyPI, 2025: A Year in Review · blog.pypi.org
- PyPI, Trusted Publishing is popular · blog.pypi.org
- PyPI and Shai-Hulud · blog.pypi.org
- PyPI, incident report: LiteLLM and Telnyx supply chain attack · blog.pypi.org
- npm ci (npm 12 documentation) · docs.npmjs.com
- npm install (npm 12 documentation) · docs.npmjs.com
- npm audit (npm 12 documentation) · docs.npmjs.com
- npm, verifying registry signatures · docs.npmjs.com
- pip, secure installs · pip.pypa.io
- pip-audit on PyPI · pypi.org