Malicious open-source packages are surging, with developers facing a new threat every six minutes. The node package manager (npm), used by millions, accounted for 75% of malicious packages identified in Q1, according to Sonatype’s Q1 2026 Malware Index.
Sonatype identified 21,764 malicious open-source packages. Most aim to steal credentials, collect reconnaissance data, or enable follow-on attacks in developer and CI/CD environments.
The trend, Sonatype said, points to an adversarial shift deemphasizing malware and instead abusing trusted packages, legitimate release paths, and routine development workflows – the software supply chain itself. (see infographic below)
Malicious npm Packages IRL
Recent incidents illustrate this pattern:
- The campaign dubbed SANDWORM_MODE used typosquatted npm packages to steal tokens, API keys, and environment variables from developer systems.
- In another case, attackers leveraged a compromised version of the Trivy security tool to help inject malicious code into the widely used LiteLLM library.
- A hijacked npm publishing account allowed attackers to slip a hidden dependency into the popular axios package, creating downstream risk for thousands of applications.
“The lesson was straightforward: attackers did not need to rewrite a popular library. They only needed to insert a malicious transitive dependency into a [trusted] package,” Sonatype said.
Instead of relying on typosquatting or low-reputation uploads, the report states, attackers are placing trojan-style payloads inside legitimate dependencies, allowing them to execute as part of normal development workflows.
Prevention starts before code is used, Sonatype said.
Teams need to shift their approach. Evaluate packages and updates before they reach developer environments. Scrutinize transitive dependencies. Treat CI/CD pipelines as high-value targets.
Assume credentials may be exposed after a malicious package runs. Adopt a zero-trust approach with continuous verification.

Feature Image by Paul Esch-Laurent on Unsplash