Malicious Package Statistics

Real-world data on malicious packages detected across package ecosystems

Data Collection Period: 2018 - June 2026 (Year-to-Date)
2026 figures represent discoveries through June and will increase as the year progresses.

Total malicious packages since 2018

NPM
214,215 packages (94.0%)
PyPI
11,436 packages (5.0%)
rubygems
990 packages (0.4%)
NuGet
820 packages (0.4%)
go
241 packages (0.1%)
crates.io
127 packages (0.1%)
Maven
37 packages (0.0%)
Packagist
36 packages (0.0%)
swift
2 packages (0.0%)

Malicious Packages Detected

Unique packages identified as malicious in vulnerability reports (2026 data through June)

Cumulative Malicious Packages

Total malicious packages discovered over time

Dramatic Increase in 2025

NPM has seen a 2198% increase in malicious packages discovered through June 2025 compared to all of 2024, with 191,336 unique malicious packages detected year-to-date.

PyPI Under Attack

PyPI experienced its peak in 2023 with 6,474 malicious packages, though 2025 numbers remain significant at 1,257 packages.

Common Attack Vectors

How malicious packages compromise developer systems

Typosquatting

Creating packages with names similar to popular ones, exploiting common typos

Dependency Confusion

Publishing malicious packages with names matching internal private packages

Compromised Accounts

Hijacking legitimate maintainer accounts to inject malicious code

Methodology

How we collect and analyze malicious package data

These statistics are derived from vulnerabilities in our database that contain the term "malicious" in their summary field (case-insensitive matching). The dataset focuses on actively reported threats, excluding withdrawn vulnerabilities that have been retracted or deemed invalid.

Each statistic represents unique package counts, not vulnerability counts. A single package may have multiple vulnerabilities, but is counted only once in these figures. Our data is continuously updated from OSV.dev vulnerability feeds, ensuring near real-time accuracy of threat intelligence.

Important Note: These numbers represent packages that have been formally identified and flagged as malicious by security researchers and vulnerability databases. The actual number of malicious packages in the wild is likely higher, as some threats may remain undetected, unreported, or are being actively investigated.