最新资讯
www.infoq.com Yelp 为 AI Assistant 融合原生与服务器驱动 UI computerworld.com Box 发布 Architect:用自然语言构建业务流程工作流 the-decoder.com METR 称 Anthropic 或已在 7 月越过自身 AI 加速预警阈值 towardsdatascience.com 用 Ollama 和 Python 构建你的第一个多工具 AI Agent the-decoder.com Thinking Machines 的 Inkling 2 Small 称霸西方开放权重模型 dev.to 为 CI/CD 构建 AI 质量门禁 dev.to Kakao 发布面向 AI Agent 的决策模型 Kanana-2-v-decide computerworld.com Microsoft 对 Copilot Chat 企业用户扩大未公开的使用限制 pub.towardsai.net Google 发布 Gemini 4 Carbon:主打网络安全能力的前沿模型 gradientflow.com METR 研究:AI 正在加速构建 AI 的团队本身 www.infoq.com GitLab 19.5 将 Agentic 开发纳入 DevOps 平台的治理体系 aiacceleratorinstitute.com 研究:AI Agent 的复杂流程编排可能反而是问题所在
多元动态
登录 注册
智能体 dev.to · @yutianle

Shai-Hulud npm 蠕虫表明:仅打开文件夹就足以执行代码

原文 我的收藏

文章复盘 2026 年 8 月的 Shai-Hulud npm 蠕虫事件:攻击者接管一名维护者的 GitHub 账号,直接向项目发布流水线推送恶意提交,生成的包版本带有有效 provenance 签名,约四小时内扩散到数百个包。代码执行并非通过 npm install,而是通过 .vscode/tasks.json 的任务定义和 .claude/settings.json 的会话钩子,在打开文件夹或启动编码 Agent 会话时触发。

AI推荐理由 描述 2026 年 8 月的 Shai-Hulud npm 蠕虫事件:攻击者接管维护者 GitHub 账号,通过项目自身发布流水线推送恶意提交,使包带有有效 provenance 签名,约四小时内扩散至数百个包。关键点在于代码并非通过 npm install 执行,而是借助 .vscode/tasks.json 和 .claude/settings.json 等编辑器与 Agent 配置文件在打开文件夹或启动 Agent 会话时触发,对开发者供应链安全与 AI 编码工具配置风险有直接警示价值;细节来自作者叙述,尚无独立事件报告佐证。

74

正文

The Shai-Hulud npm worm showed that opening a folder is enough to run code In August 2026 an attacker took over the GitHub account of a maintainer who controls widely used npm caching libraries and pushed malicious commits straight into the project's own release pipeline. The resulting package versions carried valid provenance signatures, because they were published by the project's legitimate automation. Within roughly four hours the payload had spread to hundreds of packages. The detail that matters for defenders is how the code ran on developer machines: not through npm install, but through editor and agent configuration files that execute on folder open. What actually triggered execution The worm wrote persistence into files such as .vscode/tasks.json and .claude/settings.json. A task definition in the first file can run a command when the folder is opened in Visual Studio Code. A session hook in the second can run a command when a coding agent session starts in that directory. Neither requires the developer to install a dependency, run a build, or approve a prompt. This changes the threat model for anyone who clones repositories. The traditional advice, that dependencies are dangerous and you should review what you install, assumes installation is the moment of risk. When the trigger is opening a directory, the risky action is browsing code. Why provenance did not help The malicious versions were published through the maintainer's normal GitHub Actions workflow. Any control that checks whether an artifact came from the expected build pipeline would have accepted them, because it did. Provenance answers the question "was this built by the pipeline we trust?" It does not answer "was the source that the pipeline built from trustworthy?" An attacker with commit access to the default branch satisfies the first check and defeats the second. This is not a flaw in provenance tooling. It is a boundary that has to be stated plainly: signing and provenance verify the build path, not the intent of the person who wrote the commit. What the payload collected Public analyses of the campaign describe a loader that harvests credentials from local developer environments, CI systems, cloud provider configuration, Kubernetes contexts, and secret managers. It then uses stolen npm publishing tokens to patch other packages the victim can write to, which is how the spread continued, and uses stolen GitHub tokens to modify repositories and workflow files. Two operational details are worth noting. First, the worm attempted to create a branch and a workflow file that appeared to come from an automated security tool, then downloaded the workflow's output artifact and deleted the run. Second, it read secrets through the platform's own APIs rather than scraping files, which reduces the artifacts left on disk. What defenders should change Workspace trust is the first control. Both major editors offer a trust prompt before running workspace-defined tasks, and it should not be disabled for convenience. If it is disabled, the setting is effectively an auto-execute switch for any repository the developer opens. Agent configuration files deserve the same scrutiny as CI configuration. A .claude/settings.json or equivalent that defines a session hook is executable content. Reviewing it should be part of reviewing a repository, not an afterthought. Token scope limits the blast radius. A publishing token that can write to every package a maintainer owns turns one compromised account into a supply chain event. Where the platform supports it, publishing should be restricted to specific packages and require an approval step. Detection has a concrete signature: outbound connections to newly registered domains, unexpected child processes spawned by an editor or agent, and repository commits that touch workflow or editor configuration files without a corresponding code change. Limits of this account Package counts and spread timing in this article come from vendor and press reporting of the incident, and they varied between publications as the investigation continued. The specific file paths and the general mechanism were reported consistently. This article does not claim a verified total of affected packages, and it does not attribute the campaign to a named group beyond what the cited sources state. References JFrog Security Research, analysis of the Shai-Hulud npm worm variant, https://www.jfrogchina.com/blog/shai-hulud/ Sonatype, A History of Software Supply Chain Attacks, https://www.sonatype.com/resources/vulnerability-timeline MITRE ATT&CK, Software Extensions (T1176.002), https://attack.mitre.org/techniques/T1176/002 MITRE ATT&CK, Event Triggered Execution: Component Object Model and Other (T1546.016), https://attack.mitre.org/techniques/T1546/016

来源报道 · 1 篇 · 以下链接均前往原始媒体

← 返回精选动态 原文

更多内容