← Lab /Systems

Hardening top 1% of npm packages and pruning 30% of trivial edges prevents network collapse

Applying strict security to the top 1% of npm packages and removing 30% of low-importance dependencies stops catastrophic collapse and cascading malware infections

Systems arXiv 12 Jun 2026 Defense Simulation evidence

Published as “Defending the Core: A Centrality-Based Protection Strategy for Supply Chain Security in npm Dependency Network”

Why it matters

Targeted hardening of a tiny hub set could be a cost-effective way for npm maintainers and security tools to dramatically reduce supply-chain attack impact.

Summary

The paper shows that protecting just 534 high-centrality npm packages (about 1% of the ecosystem) dramatically limits supply-chain malware spread, cutting infected packages from 1,977 to 131 (a 93.4% reduction) and keeping the largest connected component above 98% under targeted attacks. Evidence comes from simulations on the full 53,481-node npm graph comparing no protection, hub hardening, edge pruning, and a combined strategy. The results are strong but rely on simulated attacks and assume a breach probability of 15% for hardened nodes, which reduces the absorption rate to near zero.

What they found 3

  1. Combined hardening and pruning reduces cascade size to 131 infected packages (93.4% reduction).

    “Combined A+B strategy, which supplements hardened hubs with pruned edges, chokes the cascade down to just 131 packages, achieving a remarkable 93.4% reduction in systemic compromise.”

  2. Protecting 534 carefully selected nodes preserves ecosystem integrity.

    “protecting a carefully selected 534 nodes is sufficient to preserve the integrity of the entire ecosystem.”

  3. Robustness index R improves from 0.141 to 0.607.

    “Robustness index R 0.141 0.607 +0.466”

Caveats 4

  • †Under ideal hardening (pbreach = 0): 100%; under realistic pbreach = 0.15: ≈0% (some nodes breached each wave).
  • may still overlook specific topological bridges, namely those nodes with moderate degrees but extremely high out-degree that connect disparate ecosystems.
  • realworld attacks may involve more complex strategies that adapt to defenses, such as multi-vector attacks or insider threats.
  • implementation of mandatory security measures for critical nodes may face practical challenges in terms of developer compliance and ecosystem governance.

What’s new here 3

  • Applies centrality-based node hardening to a real software dependency network rather than abstract graphs.
  • Introduces a dual-pronged defense that combines hub hardening with dependency edge pruning.
  • Demonstrates that protecting a tiny fraction (534 nodes) preserves overall network integrity in realistic multi-wave attack simulations.