AMAZINGINDEX.COM 日报快照
58.4
VOL. 2026.05
2026.05.12
← 返回 2026.05.12 日报
日报快照 · Daily Snapshot
NO. 013

GitHub Actions 缓存投毒攻破 npm 供应链

#ARTICLE HackerNews 2026.05.12
推荐指数 88.0 NO. 013 · 2026.05.12
发布2026/05/11Score547Comments199

攻击者利用 pull_request_target 漏洞+GitHub Actions 缓存中毒+内存提取 OIDC token,20 分钟内向 42 个 TanStack 包发布 84 个恶意版本。这是首起公开确认的 Actions 缓存跨信任边界攻击,所有用 OIDC 发布 npm 的 CI 流水线都需审计缓存策略。

这次攻击的精妙之处在于完全绕过了 npm token——攻击者没有偷任何长期凭证,而是实时从 GitHub Actions runner 的内存里提取了临时的 OIDC token。这意味着即使你用了 GitHub 推荐的「无长期 secret」最佳实践,仍然可能中招。

更值得警惕的是缓存投毒的跨边界利用:fork 的 PR 污染了 base 仓库的缓存,这个攻击面在大量开源项目中存在但很少被审计。如果你维护着用 actions/setup-node 或类似工具缓存依赖的公开仓库,建议立即检查是否有 untrusted fork 能触发缓存写入路径。

StepSecurity 的检测速度(20 分钟)也说明供应链监控正在成熟,但被动检测不如主动防御——考虑把 OIDC 的 audience 限制收紧,以及彻底禁用 fork 对 base 缓存的写入权限。

负面 168 条评论

核心争论:NPM生态安全性崩溃,迁移他处还是全生态共病

varunsharma07

The Mini Shai-Hulud worm is actively compromising legitimate npm packages by hijacking CI/CD pipelines and stealing developer secrets. StepSecurity's OSS Package Security Feed first detected the attack in official @tanstack packages and is tracking its spread across the ecosystem in real time.

janice1999

How did you guys detect it? Do you use it internally or do you monitor popular packages?

slopinthebag

My decision to abandon the JS ecosystem and language entirely continues to pay off. What a mess... I am, however, concerned that this will pwn my workplace. We don't use Tanstack but this seems self-propagating and I doubt all of our dependencies are doing enough to prevent it.

替代方案: CargoGo getPippnpmDenoBun.NETJavaLinux distrosDocker
查看原文 →