Databricks study of 5,400 malicious npm packages shows multi-day exposure window; SafeDep outlines layered install defenses
Databricks Threat Research analyzed about 5,400 confirmed malicious npm packages published between December 2025 and October 2026. The report measures how long a malicious package stays installable before an advisory or removal. Unlinked packages got an OSV advisory at a median of 1.7 days, and North Korea-linked packages at 4.5 days. npm removed only 40% of attacker-created packages, at a median of 7.1 days, and 16% were still installable at check time. SafeDep (a vendor of the tools it promotes) published this post, which describes install-time mitigations built on its PMG and vet tools. This is a vendor blog summarizing the Databricks report. Neither the Databricks report nor the figures it quotes were independently verified, and no web research was done.
Detalhes técnicos
- Compromised legitimate packages were 7% of the set but received over 99% of downloads. 78% of compromised versions add or change a lifecycle script, and 23% show a maintainer or publisher change.
- 46% of packages declare no install script, so their code runs on import or call.
- 38% use legitimate services (Cloudflare Workers, Telegram, Discord, blockchain nodes) for communication.
- npm token theft peaked at 22% of packages in March 2026.
- 85% of malicious packages published via trusted publishing are compromises. The cache-manager and cacheable releases kept their OIDC and SLSA attestations because the attacker published them from the project's own CI.
- Attacker-created packages: 88% are under 30 days old, 81% have no downloads, 75% declare no repository, and 17% have internal-looking names. One dependency confusion campaign made up 78% of confirmed versions in August 2026.
- SafeDep cites examples: [email protected] (steals cloud keys, SSH keys, cookies and wallet data; writes .github/workflows/run-copilot.yml and .vscode/tasks.json; installs persistence), [email protected] (reads AWS credentials), and @ethersphere/[email protected] (downloads code from api.frameworkmetrics[.]xyz).
- SafeDep's test of 26 malicious releases of established packages found 23 had a malicious verdict before a two-day cooldown ended. Three took longer: two at about 52 hours and one at 25 days.
Remediação
- Run PMG (
pmg setup install) with threat-intel checks, keep the default two-day cooldown, and enable the sandbox withnetwork_mode: enforce. - Add the vet v2 GitHub Action (
vet ci init) as a required check, and setinternal_namesagainst dependency confusion. - Known limits: npm tokens stay readable in the sandbox. Writes to .claude and .cursor are not denied. The Bubblewrap fallback skips deny rules for paths that do not exist yet. Code that ignores the proxy can connect directly. Installs from a resolved tarball URL skip the cooldown.
Linha do tempo
-
Databricks study of 5,400 malicious npm packages shows multi-day exposure window; SafeDep outlines layered install defenses
ler a análise desta fonte ocultar
Databricks Threat Research analyzed about 5,400 confirmed malicious npm packages published between December 2025 and October 2026. The report measures how long a malicious package stays installable before an advisory or removal. Unlinked packages got an OSV advisory at a median of 1.7 days, and North Korea-linked packages at 4.5 days. npm removed only 40% of attacker-created packages, at a median of 7.1 days, and 16% were still installable at check time. SafeDep (a vendor of the tools it promotes) published this post, which describes install-time mitigations built on its PMG and vet tools. This is a vendor blog summarizing the Databricks report. Neither the Databricks report nor the figures it quotes were independently verified, and no web research was done.
Technical Details
- Compromised legitimate packages were 7% of the set but received over 99% of downloads. 78% of compromised versions add or change a lifecycle script, and 23% show a maintainer or publisher change.
- 46% of packages declare no install script, so their code runs on import or call.
- 38% use legitimate services (Cloudflare Workers, Telegram, Discord, blockchain nodes) for communication.
- npm token theft peaked at 22% of packages in March 2026.
- 85% of malicious packages published via trusted publishing are compromises. The cache-manager and cacheable releases kept their OIDC and SLSA attestations because the attacker published them from the project's own CI.
- Attacker-created packages: 88% are under 30 days old, 81% have no downloads, 75% declare no repository, and 17% have internal-looking names. One dependency confusion campaign made up 78% of confirmed versions in August 2026.
- SafeDep cites examples: [email protected] (steals cloud keys, SSH keys, cookies and wallet data; writes .github/workflows/run-copilot.yml and .vscode/tasks.json; installs persistence), [email protected] (reads AWS credentials), and @ethersphere/[email protected] (downloads code from api.frameworkmetrics[.]xyz).
- SafeDep's test of 26 malicious releases of established packages found 23 had a malicious verdict before a two-day cooldown ended. Three took longer: two at about 52 hours and one at 25 days.
Remediation
- Run PMG (
pmg setup install) with threat-intel checks, keep the default two-day cooldown, and enable the sandbox withnetwork_mode: enforce. - Add the vet v2 GitHub Action (
vet ci init) as a required check, and setinternal_namesagainst dependency confusion. - Known limits: npm tokens stay readable in the sandbox. Writes to .claude and .cursor are not denied. The Bubblewrap fallback skips deny rules for paths that do not exist yet. Code that ignores the proxy can connect directly. Installs from a resolved tarball URL skip the cooldown.