
人工智能编程工具正在改变开发者获取和使用软件的方式。然而,自动化软件包安装规模的不断扩大也给企业安全团队带来了新的挑战。Bloom Security发现的一个安全漏洞表明,软件发布基础设施中的薄弱环节极易与这些自动化流程产生交互影响,甚至可能导致企业遭遇恶意代码攻击,而攻击者无需窃取任何凭证即可达成目的。
AI coding tools are changing how developers obtain and use software. But the growing volume of automated package installations is creating new challenges for enterprise security teams. A vulnerability uncovered by Bloom Security demonstrates how weaknesses in software publishing infrastructure can intersect with these automated workflows. It could potentially expose organizations to malicious code without requiring attackers to steal credentials.
这项名为“SlugFest”的研究发现,有超过1,500个npm软件包存在安全漏洞,攻击者可利用这些漏洞通过篡改GitHub仓库地址实施攻击。这些软件包的总下载量更是超过了1,000万次。
The research, named SlugFest, identified more than 1,500 npm packages vulnerable to a publishing attack involving GitHub repository addresses. Together, the packages had accumulated more than 10 million downloads.
Bloom还调研了大型企业中由人工智能驱动的软件安装规模。结果显示,普通终端设备每月平均会有约70个软件包由AI代理自动安装;而开发人员的电脑上这一数值可接近350个。
Bloom also measured the scale of AI-driven software installation across large enterprises. It found that a typical endpoint receives approximately 70 packages installed by AI agents each month. Developer machines can approach 350.
这些发现引发了关于企业应如何管理软件依赖项的新讨论。如今,AI代理正越来越多地承担起为开发者挑选、安装及执行代码的任务。
The findings raise questions about how organizations should manage software dependencies. AI agents increasingly select, install, and execute code on their behalf.
企业面临的新风险层面:Bloom对数十家企业中数百万个AI代理的行为模式进行了研究。结果显示,不同类型的AI代理每日安装的软件包数量在0.3至1.2个之间;开发人员的电脑上这一数值更高,每日平均有2至3个软件包被直接安装。
A New Layer of Enterprise Exposure Bloom studied the behavior of millions of AI agents across dozens of organizations. Individual agents install between 0.3 and 1.2 packages per day, depending on the agent type, the research found. Developer machines experience higher activity, with two to three direct package installations daily.
通常情况下,每台终端设备上会运行3个AI代理,它们分别通过命令行界面、集成开发环境、扩展插件及辅助工具发挥作用;开发人员的电脑上则可能运行5个甚至更多此类代理。上述数据尚未计入那些由已安装软件包自动引入的额外依赖项,因此实际软件使用规模可能远超统计数值。
The average endpoint runs three agents across command-line interfaces, IDEs, extensions, and assistants. Developer machines can run five or more. These figures do not include the additional dependencies that directly installed packages bring in. The full software footprint can therefore extend beyond the reported totals.
这种自动化安装模式为不可信代码进入企业环境创造了更多可乘之机。由于无需人工逐一审核每个依赖项,这些软件包便可能直接执行安装脚本,包括所谓的“安装后钩子”程序。
This activity creates more opportunities for untrusted code to enter an environment. Packages may execute installation scripts, including postinstall hooks, without a developer individually reviewing every dependency.
Bloom 报告称,他们发现并阻止了一名客户使用的 AI 工具尝试安装受该漏洞影响的软件包。这一事件实际展示了自动化开发工作流程与研究中提到的软件供应链安全问题之间的关联。
Bloom reported catching and blocking a customer’s AI agent attempting to install one of the packages affected by the vulnerability. The incident illustrated a practical intersection between automated development workflows and the software supply-chain exposure described in the research.
导致该漏洞的发布机制:该漏洞与 npm 的“可信发布(Trusted Publishing)”功能有关。该机制旨在通过使用短期凭证来替代长期有效的发布令牌,从而提高安全性。具体而言,GitHub Actions 工作流会从 GitHub 获取一个 OpenID Connect 令牌,并用该令牌从 npm 获取临时发布凭证。这种做法减少了系统构建过程中对静态密钥的依赖,从而降低了安全风险。
The Publishing Mechanism That Created the Risk The vulnerability involved npm Trusted Publishing. The system is designed to improve security by replacing long-lived publishing tokens with short-lived credentials. Under the mechanism, a GitHub Actions workflow obtains an OpenID Connect token from GitHub. It exchanges it with npm for a temporary publishing credential. The approach reduces dependence on static secrets that build systems or logs might otherwise expose.
然而,Bloom 发现 npm 在建立信任关系时仅使用了 GitHub 仓库的可见地址(即仓库的“slug”标识),而没有立即记录该仓库的永久性标识符。当仓库所有者重新命名、转移或删除仓库时,这些信息可能会被其他人获取。如果某个软件包的“可信发布配置”仍然引用旧的仓库地址,那么另一个仓库就可能被误认为是合法的发布源,从而绕过原有的安全验证机制。
However, Bloom found that npm initially established the trust relationship using a GitHub repository’s human-readable address, or slug. It did not immediately record its permanent repository identifier. That distinction becomes important when owners rename, transfer, or delete repositories. Their previous addresses can become available for someone else to claim. A package’s Trusted Publisher binding may still reference the old address and may not yet have produced a successful publication.
单一漏洞如何影响下游项目:Bloom 通过受研究人员控制的 GitHub 仓库以及属于该研究人员的所有权的 npm 软件包,演示了这一漏洞的危害。他们成功从另一个组织的仓库中向目标软件包发布了新版本。问题的关键在于:这些仓库的“slug”标识可以被其他人获取并滥用。这意味着攻击者无需窃取软件包维护者的合法凭证或入侵其 GitHub 账户,就能实现非法发布。
In that case, another repository could potentially satisfy the original trust configuration. The result is a route to publishing access. It does not depend on stealing the legitimate maintainer’s credentials or compromising their GitHub account. How a Single Weakness Can Reach Downstream Projects Bloom demonstrated the issue using researcher-controlled GitHub repositories and an npm package under a researcher-owned scope. The team successfully published to the package from a second repository belonging to another organization.
总之,这个漏洞揭示了自动化开发流程中的安全漏洞可能对整个软件供应链造成的潜在威胁。
The shared element was the repository slug, which had become available for reclamation.
一旦攻击者获得发布权限,便可以合法的包名发布恶意版本。此时,原有的下载量、信誉度以及依赖关系仍会与该包名相关联。
Once an attacker obtains publishing access, they can release a malicious version under the legitimate package name. Existing download counts, reputation, and dependency relationships remain associated with that name.
接下来的环节便是软件分发。AI代理程序可自动解析依赖关系并安装最新版本。实际上,通常并无专人逐一审核每个软件包的来源与发布历史。倘若恶意版本中包含安装后执行脚本,该脚本便能在开发者的电脑或持续集成系统中于安装过程中运行。
The next stage involves distribution. AI agents may automatically resolve dependencies and install the latest available versions. No person necessarily reviews every package’s origin or release history. If a malicious release includes a postinstall hook, its code can execute during installation on developer machines or continuous integration systems.
这项研究还发现,软件来源验证机制存在一处潜在漏洞:恶意版本可附带由攻击者自身代码库生成的验证凭证。部分系统仅会检查是否存在此类凭证,而不会核实其来源是否与预期的维护者代码库相符,因此可能无法察觉其中的异常。这些发现对安全负责人的启示Bloom对整个注册表进行的扫描共发现超过1,500个存在安全漏洞的软件包,这些包的总下载量超过1,000万次,其中每月下载量均超过100万次。
The research also identifies a potential blind spot in provenance verification. A malicious release can carry an attestation associated with the attacker’s own repository. Some systems verify only that an attestation exists, without checking whether its source matches the expected maintainer repository. They may fail to identify the discrepancy. What the Findings Mean for Security Leaders Bloom’s registry-wide scan identified more than 1,500 vulnerable packages. They had over 10 million combined downloads and more than one million downloads per month.
研究人员指出,这些数据仅涉及启用了“可信发布”功能的软件包,这类软件包仅占npm生态体系中的一部分。
The researchers cautioned that these figures refer to packages configured for Trusted Publishing, a subset of the npm ecosystem.
对企业安全负责人而言,这些发现意味着单纯掌握软件依赖清单未必能确保足够的安全防护。自动化软件安装机制本身亦会带来相应风险。Bloom建议企业不仅要审核常规软件包,还应将扩展程序、应用程序、插件、代码库、MCP服务以及各类功能模块纳入审计范围。
For enterprise security leaders, the findings suggest that dependency inventories alone may not provide sufficient protection. Automated software installation introduces risks of its own. Bloom recommends auditing installed software beyond traditional packages, including extensions, applications, plugins, repositories, MCPs, and skills.
此外,Bloom还建议企业部署供应链防火墙以管控进入企业环境的软件,并制定相应政策以确保员工能够安全地使用各类AI代理程序。
The company also recommends enforcing a supply-chain firewall to control what enters enterprise environments and establishing policies that allow employees to use AI agents securely.
包维护者负有独立的审查发布权限的责任。Bloom建议运行npm信任列表,并检查所有已配置的仓库地址是否仍然指向其控制的仓库。此外,Bloom还建议在仓库重命名或转移后重新创建信任绑定。当已绑定的仓库不再需要时,删除该仓库也应触发其相关信任配置的移除。
Package maintainers have a separate responsibility to review publishing permissions. Bloom advises running npm trust list and checking that every configured repository address still resolves to a repository under their control. It also advises recreating trust bindings after repository renames or transfers. Deleting a bound repository should also prompt removal of its associated trust configuration when it is no longer needed.
超过120天后的修复措施:Bloom于2026年6月6日通过GitHub的HackerOne项目报告了该漏洞。GitHub于6月9日进行了分类和验证。在最终修复之前,最后一次回应出现在7月8日。
A Remediation After More Than 120 Days Bloom reported the vulnerability through GitHub’s HackerOne program on June 6, 2026. GitHub triaged and validated it on June 9. The last response before the eventual fix came on July 8.
在提出六项额外查询(包括一项调解请求)后,Bloom准备发布其研究成果。在发布前,Bloom将研究结果发送给了npm,并重复了攻击测试。测试发现,npm已经实施了修复措施。随后,npm确认了修复情况,并为沟通延迟致歉。
After six additional enquiries, including a mediation request, Bloom prepared to publish the research. Before publication, it sent its findings to npm and repeated the attack test. It discovered that npm had implemented a fix. npm subsequently confirmed the remediation and apologized for the delayed communication.
Bloom提出的解决方案是:在建立信任时存储不可变的仓库和所有者标识符,然后在发布授权期间通过OIDC令牌验证仓库标识符。研究人员指出,PyPI的Warehouse已经采用了这种方法,而该问题也影响了npm的GitLab可信发布实现。
Bloom’s proposed solution was to store immutable repository and owner identifiers when establishing trust, then verify the repository identifier in the OIDC token during publishing authorization. The researchers noted that PyPI’s Warehouse already follows this approach and that the issue also affected npm’s GitLab Trusted Publishing implementation.
核心问题并非自动化发布或AI编码工具本身不安全。相反,这项研究揭示了自动化开发如何放大信任关系破裂所带来的后果。
The central issue is not that automated publishing or AI coding tools are inherently unsafe. Rather, the research shows how automated development can magnify the consequences of a broken trust relationship.
随着软件开发日益自动化,组织必须确保用于发布和安装代码的系统能够验证源代码的名称,并确认该源代码是否正是它们原本打算信任的那个来源。
As software creation becomes increasingly autonomous, organizations must ensure that the systems publishing and installing code verify what a source is called. They must also verify whether it is the source they actually intended to trust.
本文为贡献文章,并非由TNW新闻编辑部制作,也不反映TNW的编辑立场。
Contributed article. Not produced by the TNW newsroom and does not reflect the editorial stance of TNW.