The dependency is the attack surface: 845,204 malicious packages and what they target
Sonatype has now logged 845,204 malicious open-source packages — up 188% year over year — with 55% built to exfiltrate secrets. Modern supply-chain defence starts with the uncomfortable admission that every dependency is code you did not review.
By A6X Editorial
Security engineering · threat data
The modern software supply chain is a miracle of leverage: a few lines of configuration pull in thousands of person-years of work. It is also an attack surface with no perimeter. Sonatype's quarterly Open Source Malware Index now counts 845,204 malicious packages discovered across npm, PyPI, Maven Central and other ecosystems — a 188% increase compared with the same quarter a year earlier.
In the second quarter of 2025 alone, researchers logged 16,279 new malicious packages. The payload mix tells you what attackers actually want.
What the payloads are after
Sonatype Open Source Malware Index · shares of discovered packages
Data exfiltration dominates. 55% of malicious packages discovered were designed to steal secrets, credentials, tokens, API keys and personal data. More than 4,400 packages in Q2 were explicitly built for data theft. The target is not usually your production database first; it is the developer laptop, the CI runner and the environment variables that unlock everything else.
The second signal is sabotage. Data-corruption malware doubled in frequency to more than 3% of malicious packages — over 400 unique instances in the quarter. Cryptominers fell slightly to about 5%, consistent with a shift toward higher-impact, harder-to-detect objectives.
Anatomy of a package attack
Most attacks follow a predictable chain: a plausible package name or a typosquat, a useful-looking README, a post-install script or an obfuscated loader, then credential collection and outbound traffic to an attacker-controlled endpoint. Some campaigns are patient: a package stays harmless for months to build trust before a malicious version is published. Nation-state actors are part of the picture too — Sonatype attributed 107 packages in Q2 to the Lazarus Group, collectively downloaded more than 30,050 times.
“Attackers have stopped experimenting with open source. They have identified data as the most profitable target and developers as the easiest way in.”Brian Fox, CTO, Sonatype — Q2 2025 malware index
A defence that fits real teams
- Block at the registry, not at review time. A repository firewall that rejects known-malicious packages before installation beats a ticket asking developers to be careful.
- Use cooldown windows. Refuse versions published in the last 24–72 hours by default; most malicious releases are caught quickly by the ecosystem.
- Inventory transitive code. SBOMs are useful when they are generated in CI and actually queried during incidents.
- Kill post-install surprises. Prefer installs with scripts disabled, then allow-list the packages that genuinely need them.
- Separate CI secrets. Short-lived tokens, environment scoping and least privilege turn a compromised dependency from a breach into an incident.
- Rehearse the response. Know how to pin, fork, vendor or remove a package under pressure — before you need to.
The uncomfortable truth: you cannot review every dependency. You can control where packages come from, how fast they enter your build, what credentials they can see, and how quickly you can remove them. Those four controls cover most of the realistic attack surface.
Sources & further reading
Tagged
Related insights
AI made teams faster. DORA found delivery got shakier.
DORA’s 2024 research found AI improves individual productivity, flow and job satisfaction — while also reducing delivery stability and throughput. The...
The 56% web: why half the internet still fails Core Web Vitals
In the October 2026 Chrome UX Report, only 56.3% of origins had good Core Web Vitals. LCP remains the biggest gap, while INP is improving. The remaini...
Designing Systems for the Next Decade
Software is usually designed for the moment it is written. The systems that last are designed for the years that follow.