Mini Shai-Hulud 供应链攻击扩散:AI 工具链成重灾区

Mini Shai-Hulud 供应链攻击扩散:AI 工具链成重灾区

一场代号为 Mini Shai-Hulud 的 npm/PyPI 供应链攻击在本周持续扩大,目标明确指向 AI 开发者工具链。这场最初针对 TanStack 的攻击已经蔓延至 OpenSearch、Mistral AI、Guardrails AI、UiPath 等多个项目。

@IntCyberDigest 详细披露了攻击的技术细节:

The malware specifically targets AI developer tooling. It hooks into Claude Code (.claude/settings.json) and VS Code (.vscode/tasks.json) to re-execute on every tool event, long after the infected package is gone. npm uninstall does not fix this.

最值得关注的是其持久化机制: 恶意代码会植入 Claude Code 的 .claude/settings.json 和 VS Code 的 .vscode/tasks.json 配置文件中。这意味着即使删除了受感染的包,每次开发者启动 Claude Code 或 VS Code 时,恶意代码仍会重新执行。简单运行 npm uninstall 完全无法清除感染。

@guardrails_ai 随后确认其开源包 guardrails-ai 0.10.1 被攻陷:

Security advisory: our open source guardrails-ai 0.10.1 was compromised yesterday as part of the Mini Shai-Hulud campaign. Caught and quarantined within ~2hrs on PyPI.

Guardrails AI 表示在约 2 小时内完成检测并在 PyPI 上隔离了问题包。

针对这类攻击,安全社区迅速给出了具体缓解建议。@ramimacisabird 指出:

Everyone is tweeting out 'use pnpm & set a minimumReleaseAge of 7 days' but don't forget blockExoticSubdeps - which would also prevent the usage of a remote github reference here!

除了设置 minimumReleaseAge,还需要启用 blockExoticSubdeps 来阻止远程 GitHub 引用混入依赖图。此外,@andersonbcdefg 建议将密钥从通用的 .env 文件迁移到专门的密钥管理器中,以降低攻击面。

在更广泛的背景下,斯坦福团队也在同一时间发布了 SecureForge——一个通过提示优化来发现和预防 LLM 生成代码中安全漏洞的系统。这标志着代码生成安全评估正在从附属问题转变为 AI 基础设施的核心组成部分。

⚖️ 政策/监管

本作品采用《CC 协议》,转载必须注明作者和本文链接
讨论数量: 0
(= ̄ω ̄=)··· 暂无内容!

讨论应以学习和精进为目的。请勿发布不友善或者负能量的内容,与人为善,比聪明更重要!