AI Security AI安全 4h ago Updated 1h ago 更新于 1小时前 43

Over 400 NPM Packages Infected in ChainDrop Supply Chain Attack ChainDrop供应链攻击致400多个NPM包感染

A supply chain attack dubbed ChainDrop published over 2,200 malicious versions of 440 NPM packages, leveraging compromised maintainer accounts in the keyv and cacheable namespaces The malware, an evolved descendant of Shai-Hulud 2.0, uses a technique called EtherHiding to employ the Ethereum blockchain for command-and-control communications The worm self-propagates by using stolen NPM credentials to republish poisoned package versions and GitHub credentials to inject malicious configuration file ChainDrop供应链攻击在npm注册表发布了超过2,200个恶意版本,涉及440个包,感染包周下载量超5亿 攻击始于11个恶意载体入侵keyv和cacheable命名空间,利用preinstall钩子植入信息窃取器并自我传播 恶意软件采用EtherHiding技术,将命令与控制通信隐藏在Ethereum区块链交易中 感染机器上的恶意软件会窃取NPM、GitHub、AWS、Kubernetes等凭证,并利用这些凭证继续发布恶意包和感染GitHub仓库 恶意软件部署了"死手开关",每60秒验证GitHub凭证有效性,凭证失效或24小时后自动清除

65
Hot 热度
65
Quality 质量
55
Impact 影响力

Analysis 深度分析

TL;DR

  • A supply chain attack dubbed ChainDrop published over 2,200 malicious versions of 440 NPM packages, leveraging compromised maintainer accounts in the keyv and cacheable namespaces
  • The malware, an evolved descendant of Shai-Hulud 2.0, uses a technique called EtherHiding to employ the Ethereum blockchain for command-and-control communications
  • The worm self-propagates by using stolen NPM credentials to republish poisoned package versions and GitHub credentials to inject malicious configuration files into repositories via GitHub Actions
  • Infected packages carry a preinstall dropper that downloads the Bun JavaScript runtime and 710 KB of obfuscated second-stage malware, targeting secrets from developer workstations and CI/CD environments
  • The malware includes a dead-man's switch that polls the GitHub API every 60 seconds and self-terminates if the stolen token becomes invalid or after 24 hours

Why It Matters

This attack demonstrates the escalating sophistication of supply chain threats targeting the JavaScript ecosystem, with over 500 million weekly downloads at risk across widely used packages. The use of blockchain-based C2 (EtherHiding) and automated self-propagation through compromised credentials represents a significant evolution in malware tradecraft that threatens not only individual developers but the broader software supply chain.

Technical Details

  • The attack originated from 11 compromised packages in the keyv and cacheable namespaces after the maintainer's GitHub account was breached, cascading to infect 433 additional packages
  • The malware dropper executes during npm install, downloading the legitimate Bun JavaScript runtime alongside obfuscated second-stage code (710 KB) that functions as an information stealer
  • Stolen credentials are used to authenticate across NPM, GitHub, AWS, Kubernetes, and HashiCorp Vault, enabling enumeration of packages, repositories, workflow secrets, and cloud parameters
  • The worm republishes poisoned versions by downloading tarballs, inserting malware and a preinstall hook, incrementing patch versions, and republishing — achieving 2,212 malicious iterations in under four hours
  • C2 communication uses EtherHiding (Ethereum blockchain), and the dead-man's switch deletes state and exits if the GitHub token stops working or after 24 hours

Industry Insight

  • Organizations should enforce strict package integrity verification and consider software bill of materials (SBOM) practices to detect tampered dependencies before deployment
  • The rapid self-propagation capability (2,200+ versions in under four hours) underscores the need for real-time supply chain monitoring and automated anomaly detection in package registries
  • Developers should rotate credentials immediately, rebuild CI/CD runners from clean images, and audit GitHub repositories for injected configuration files in Claude and VS Code settings

TL;DR

  • ChainDrop供应链攻击在npm注册表发布了超过2,200个恶意版本,涉及440个包,感染包周下载量超5亿
  • 攻击始于11个恶意载体入侵keyv和cacheable命名空间,利用preinstall钩子植入信息窃取器并自我传播
  • 恶意软件采用EtherHiding技术,将命令与控制通信隐藏在Ethereum区块链交易中
  • 感染机器上的恶意软件会窃取NPM、GitHub、AWS、Kubernetes等凭证,并利用这些凭证继续发布恶意包和感染GitHub仓库
  • 恶意软件部署了"死手开关",每60秒验证GitHub凭证有效性,凭证失效或24小时后自动清除

为什么值得看

此次ChainDrop攻击展示了供应链攻击的规模化能力,单一维护者账号泄露即可影响5亿周下载量的生态。攻击者结合区块链C2、死手开关和双重传播路径(npm+GitHub Actions)的技术组合,为安全从业者提供了重要的威胁情报参考。

技术解析

  • 攻击入口:通过preinstall钩子下载合法Bun运行时和710KB混淆的第二阶段恶意代码,在包安装时执行
  • C2通信:采用EtherHiding技术,将命令与控制指令编码在Ethereum区块链交易中,规避传统网络检测
  • 自我传播:利用被盗NPM token枚举并重新发布恶意包(增量patch版本),同时通过GitHub Actions和Claude/VSCode配置文件注入建立持久化
  • 反检测设计:部署主机级死手开关,每60秒轮询GitHub API验证凭证有效性,凭证失效或24小时后自动清除状态

行业启示

  • 包维护者账号安全至关重要,需强制启用多因素认证和访问审计,单一账号泄露即可造成生态级影响
  • 企业应建立npm包安装监控机制,特别关注preinstall脚本等高风险操作,并定期审计依赖链
  • 供应链攻击应急响应需标准化:隔离系统、保留tarballs和日志、重建CI环境、轮换所有相关凭证

Disclaimer: The above content is generated by AI and is for reference only. 免责声明:以上内容由 AI 生成,仅供参考。

Security 安全 Open Source 开源