What 5,400 Malicious npm Packages Reveal about Software Supply Chain Risk in 2026

What happened
Researchers analyzed 5,400 confirmed malicious npm packages published between December 2025 and October 2026. They found that most downloads of malicious code came from legitimate packages that had been compromised, not from packages created by attackers from scratch. Attackers increasingly exploited build pipelines and targeted tools used in AI development. The study also noted that attackers often used legitimate cloud services to communicate and that removal of malicious packages from the registry was often delayed.
Key details
- 89% of malicious packages were attacker-created, but these accounted for only 0.2% of downloads.
- Over 99% of malicious package downloads came from compromised legitimate packages, which made up 7% of the set.
- In August 2026, a single dependency-confusion campaign accounted for 78% of confirmed malicious package versions.
- 54% of malicious packages used lifecycle scripts to execute code, while others ran code on import or invocation.
- Targeting of AI developer credentials was present in 1-4% of packages throughout the year.
Why it matters
Developers and organizations using npm are at increased risk of compromise, especially when relying on trusted packages that may have been taken over by attackers. AI development teams are specifically being targeted, with attackers seeking to steal credentials and modify AI assistant configurations. The slow removal of malicious packages means that users may be exposed to threats for days or even weeks after a package is reported, increasing the risk of supply chain attacks.