Databricks analyzed 5,400 malicious npm packages: 7% hijacked legit ones drove 99% of bad downloads
lxfater · x · 2026-11-24
Databricks dissected 5,400 malicious npm packages over the past year, and the data flips common assumptions: typosquat fakes are under 5%, attacker-published packages make up 89% but only 0.2% of downloads — while compromised legitimate packages, just 7% of the total, accounted for over 99% of malicious downloads.
How they work
- 54% run install-time scripts automatically; the rest stay silent until code execution
- 78% of hijacked legit packages added or modified install scripts in the malicious release (see chart)
- Targets: cloud credentials, SSH keys, .env files — and AI tools specifically. Some pose as MCP plugins (half exfiltrate cloud creds), some tamper with AI assistant configs/instructions, and 80% of AI-key-stealing packages go after nothing else
Why takedowns fall short: median npm removal takes 7 days; 16% of attacker packages were still installable during verification.
Three defenses
- Use --ignore-scripts for unfamiliar packages — blocks half of attacker packages and recent hijack waves
- Pin versions: 88% of malicious packages were under 30 days old at poisoning time
- Cap local key permissions and audit assistant config after installing third-party MCP servers
More from coding & agent
- Hands-on: Neon + T3 Code shines with 500k-700k token chats, 3D and game design — rachittshah · 2026-11-24
- Hands-on with Neon + T3 Code: solid at 500k-700k context, shines at 3D and game dev — rachittshah · 2026-11-24
- AutoPILOT: a visual agent harness for real-time gameplay with LLMs — UIUC-CS · 2026-11-24
- Google open-sources gemini-api-cli: a multimodal sidecar for coding agents, 85.8% token savings — Promptmethus · 2026-11-24
- OpenAI and AWS to host Codex Build Night during NeurIPS next month — gabrielchua · 2026-11-24
- Engineer open-sources 45 agent skills from shipping 3 products: multi-model division of labor — FinanceYF5 · 2026-11-24