AI Security AI安全 19h ago Updated 14h ago 更新于 14小时前 46

Rust Supply Chain Attack Linked to North Korean Hackers Rust供应链攻击与朝鲜黑客有关联

North Korean threat actor Sapphire Sleet compromised the popular Rust crate `arrayref` (245M+ downloads, ~75% of Rust environments) on August 20 via a supply chain attack The attack involved publishing malicious versions of `arrayref`, `internment`, and `append-only-vec`, all referencing a typosquatted `proc-macro1` package that impersonated the legitimate `proc-macro2` A malicious `build.rs` script disabled TLS certificate validation and fetched a platform-specific second-stage binary over the 朝鲜黑客组织Sapphire Sleet针对Rust生态系统发起供应链攻击,入侵了下载量超2.45亿、覆盖75% Rust环境的arrayref crate 攻击者通过typosquatting创建恶意proc-macro2包,在build.rs中嵌入恶意代码,通过TLS禁用证书验证后获取第二阶段载荷 Rust安全团队在86分钟内响应并移除恶意包,未发现实际恶意使用证据,维护者账号可能已遭入侵 攻击基础设施与之前的Axios和Mastra NPM供应链攻击高度关联,均使用Hostwinds LLC IP段

72
Hot 热度
62
Quality 质量
58
Impact 影响力

Analysis 深度分析

TL;DR

  • North Korean threat actor Sapphire Sleet compromised the popular Rust crate arrayref (245M+ downloads, ~75% of Rust environments) on August 20 via a supply chain attack
  • The attack involved publishing malicious versions of arrayref, internment, and append-only-vec, all referencing a typosquatted proc-macro1 package that impersonated the legitimate proc-macro2
  • A malicious build.rs script disabled TLS certificate validation and fetched a platform-specific second-stage binary over the network
  • The Rust Security Response Team removed all malicious packages within ~86 minutes; no evidence of actual usage or exploitation was found
  • Infrastructure overlaps (Hostwinds LLC IP ranges, C&C endpoints) link this attack to prior Sapphire Sleet campaigns targeting NPM packages Axios and Mastra

Why It Matters

This attack demonstrates how supply chain compromises in widely-used dependency ecosystems can achieve massive blast radius with minimal effort, as arrayref is present in roughly three-quarters of all Rust environments. It also highlights the growing sophistication of state-sponsored threat actors like Sapphire Sleet, who are systematically expanding their attack surface across multiple package registries (NPM and crates.io).

Technical Details

  • The attacker compromised the arrayref maintainer's credentials and published [email protected], which added a direct dependency on proc-macro1 — a typosquatted package impersonating the legitimate proc-macro2 crate
  • Two additional crates from the same owner (internment, append-only-vec) and four attacker-owned crates (aovine, arone, aronenao, tinymember) all referenced the same malicious proc-macro1 dependency
  • The malicious proc-macro1 package contained a build.rs script that disabled TLS certificate validation and downloaded a platform-specific second-stage payload over HTTPS during the build process
  • StepSecurity's analysis revealed the attacker created the typosquatted proc-macro1 package and the impersonating crates.io account with precise timing, right before publishing the poisoned arrayref release
  • The Rust Security Response Team confirmed the compromise and restored clean versions within 86 minutes; no evidence of downstream exploitation was found

Industry Insight

  • Dependency typosquatting remains a highly effective attack vector; organizations should enforce strict dependency pinning and audit build scripts, especially for high-impact crates with broad transitive dependencies
  • The pattern of Sapphire Sleet targeting multiple registries (NPM → crates.io) suggests a coordinated, multi-platform strategy — security teams should monitor cross-registry infrastructure overlaps and threat actor TTPs
  • The 86-minute response time is commendable but underscores the need for automated supply chain monitoring and SBOM (Software Bill of Materials) adoption to detect and contain compromised dependencies before they propagate

TL;DR

  • 朝鲜黑客组织Sapphire Sleet针对Rust生态系统发起供应链攻击,入侵了下载量超2.45亿、覆盖75% Rust环境的arrayref crate
  • 攻击者通过typosquatting创建恶意proc-macro2包,在build.rs中嵌入恶意代码,通过TLS禁用证书验证后获取第二阶段载荷
  • Rust安全团队在86分钟内响应并移除恶意包,未发现实际恶意使用证据,维护者账号可能已遭入侵
  • 攻击基础设施与之前的Axios和Mastra NPM供应链攻击高度关联,均使用Hostwinds LLC IP段

为什么值得看

此次攻击展示了高级威胁组织如何精准利用开源生态的依赖链进行供应链攻击,对Rust开发者社区和开源软件安全实践具有重要警示意义。

技术解析

  • 攻击者创建了typosquatted版本的proc-macro2包(proc-macro1),并在恶意crate的build.rs中嵌入恶意代码,通过TLS获取平台特定的第二阶段二进制文件,同时禁用了证书验证
  • 恶意包包括arrayref@0.6.3、internment和append-only-vec,以及攻击者控制的aovine、arone、aronenao、tinymember等crate,均引用相同的恶意依赖
  • 基础设施复用:payload beacon指向Mastra攻击的端点,C2流量指向Axios攻击的IP,三次攻击均使用Hostwinds LLC的IP段
  • Rust安全响应团队在86分钟内移除恶意包并恢复干净版本,确认维护者账号可能已被入侵而非主动作恶

行业启示

  • 开源供应链安全已成为国家级威胁组织的重要攻击目标,需要建立更严格的依赖验证和包发布监控机制
  • 开发者应关注核心依赖的安全状态,特别是高频使用的工具库,建议启用依赖锁定和定期安全审计
  • 开源生态需要加强维护者账号保护和应急响应能力,建立更快速的恶意包检测和移除流程

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

Security 安全 Open Source 开源 Research 科学研究