深海军蓝背景上的抽象技术插图:一条宽阔的半透明边界围住一排代表服务器的小型几何面板;一条细请求线在没有任何凭证令牌伴随的情况下进入边界,在穿过边界处变为琥珀色,随后径直进入其中一块面板上的小方形门洞,一根细青色丝线从门洞中逸出,并延伸出画面右边缘。第二条完全相同的请求线被一条短白条拦在边界处。图中不出现文字、人物或组织标志。OrcaRouter 标志合成在右下角。
AI Safety Incidents

AgentScope 的 MCP 工作区会启动你指定的任意程序 — CVE-2026-123022

作者

Alistair Wren

发布日期

最新模型 · 20查看全部模型 →
基准测试:Artificial Analysis · 每日更新
返回全部文章

2026 年 11 月 5 日,VulDB CNA 发布了 CVE-2026-123022,这是 AgentScope 的 MCP Workspace API 中的一个操作系统命令注入漏洞(CWE-78);AgentScope 是由 agentscope-ai 维护的开源多智能体框架。截至 2026 年 11 月 9 日,尚无修复版本,因为 PyPI 上的最新版本仍是 2.0.11,而该 CVE 列出的最后一个受影响版本也正是它。能够访问已暴露的 AgentScope 智能体服务的调用方可以注册一个 stdio MCP,其 command 字段可指定任意本地可执行文件,服务器便会以运行该服务的用户身份启动该程序;报告者的概念验证于 2026 年 7 月 8 日在 Windows 11 主机上写入了一个标记文件。尚未有在野利用的报告。本条记录是以下档案中的一条:AI 事件档案,该档案将它和过去一年其他智能体基础设施与 MCP 漏洞一并收录,每条记录都带有各自的来源、严重性、置信度等级和争议标记。

AgentScope 并非一个小型副项目。其 GitHub 仓库将其描述为一个“构建并运行你能看到、理解和信任的智能体”的框架,采用 Apache-2.0 许可证,并在 2026 年 11 月 9 日查询时拥有约 35,600 个星标。该框架附带一个智能体服务——一个包含 workspace、session、agent 和 credential 路由器的 FastAPI 应用——并且,在仓库自带的示例部署文件 examples/agent_service/main.py中,将其绑定到 0.0.0.0 的 8000 端口。这就是该 CVE 所涉及的攻击面:不是模型,也不是提示词,而是操作者为了让智能体及其工具能够被远程管理而暴露的端点。

这个缺陷实际上是什么

MCP stdio 服务器并不是一个 URL。在 Model Context Protocol 规范中,它是一个程序名加上一个参数列表,宿主需要启动该程序,然后通过标准输入和输出与之通信。AgentScope 允许调用方通过 HTTP 定义一个这样的服务器:POST /workspace/mcp,其实现位于 src/agentscope/app/_router/_workspace.py,它接受一个 JSON 请求体,其中包含类型为 mcp_config 的 stdio_mcp。在 2.0.11 的源码中,StdioMCPConfig.command在 src/agentscope/mcp/_config.py中被声明为普通字符串,既没有校验器,也没有允许列表和受信任目录限制,而调用方提供的 args、env和cwd则随之一起传递。

随后,该值被交给 MCP SDK。在 2.0.11 中,src/agentscope/mcp/_mcp_client.py 将 config.command 和 config.args 传入 StdioServerParameters 和 stdio_client,这是 SDK 传输层,会使用 subprocess.Popen 启动子进程。由 VulDB 编写的 CVE 描述将那次 Popen 调用归因于 _config.py;在源码中,该字段正是在那里定义的,而进程启动发生在下一层,即 SDK 中。无论哪种方式,效果都一样,并且报告者毫不含糊地指出:远程调用者放入 command 的字符串会变成宿主机上的一个进程。

时机使它成为单个请求,而不是两步式设置。对于有状态的 MCP——而 stdio 客户端始终是有状态的——LocalWorkspace.add_mcp 调用 mcp_client.connect(),而这一切发生在请求返回之前。在 2.0.11 中,这就是 is_stateful and not is_connected 分支,位于 src/agentscope/workspace/_local_workspace.py,它会等待 connect(),然后才保存工作区文件。当 MCP 握手失败时,进程已经在运行,这就是为什么报告者的证据是一个 HTTP 500,同时还有一个已存在的文件。

使该端点无需凭据即可访问的,是同一应用中的另一项独立设计决策。get_current_user_id位于src/agentscope/app/deps.py,会读取X-User-ID 请求头,只拒绝空字符串,并将调用方发送的任何内容作为已认证身份返回。它自己的文档字符串称其为“临时的基于请求头的身份;将由 JWT 认证取代”。每个工作区路由都依赖它,因此 CVE 描述中的“未经认证”就是字面意思:攻击者自行选择的一个非空请求头就是认证的全部。

已建立,以及未建立

HTML card titled 'What the record establishes — and what it does not', kicked 'Record 2026-11-05-agentscope-mcp-command-injection-cve-2026-123022' and subtitled with its source list: the VulDB CVE record and NVD's copy of CVE-2026-123022 dated 5 November 2026, OpenCVE, AgentScope issue #3312 and pull request #3448, the reporter's advisory, and Red Hat's CVE page. Two columns run side by side. The left column, headed 'Established' in cyan and subheaded 'Present in the source at tag 2.0.11, or stated by a cited source', lists six items: CWE-78 and CWE-77 OS command injection, with StdioMCPConfig.command in src/agentscope/mcp/_config.py a plain string with no validator or allowlist that is passed to the MCP SDK's subprocess.Popen spawn; versions 2.0.0 through 2.0.11 listed as affected in the CVE record and mirrored by NVD; POST /workspace/mcp resolving identity from the caller-supplied X-User-ID header, checked only for non-emptiness; the process starting on save for stateful stdio MCPs, before the handshake, because add_mcp() awaits connect() first; a marker-file proof of concept against 2.0.4 on Windows 11 on 8 July 2026 per the reporter, with an independent reproduction posted on the issue on 15 October 2026; and no fixed release, since 2.0.11 is still the newest version on PyPI as of 27 October 2026 and pull request #3448 is open, unreviewed and unmerged. The right column, headed 'Not established' in amber and subheaded 'Absent from every cited source as of 9 November 2026', lists six items: no in-the-wild exploitation, with NVD's SSVC block reading exploitation none and no CISA KEV entry; NVD's status still 'Deferred' four days after publication, with no NVD analysis of its own; no maintainer-written GitHub Security Advisory, since GHSA-m997-8g56-6phf is an unreviewed import of the CVE with severity 'medium'; no count of exposed deployments and no statement from the maintainers in the public thread; no fixed version to upgrade to and no security release scheduled; and severity that does not agree — 7.3 High, 6.9 Medium, 5.5 Medium, 7.5 High, and a Red Hat rating of Critical impact. A footer reads 'Facts as published by the VulDB CVE record and NVD, OpenCVE, GitHub issue #3312 and PR #3448, the reporter's advisory, Red Hat and PyPI. Card rendered by OrcaRouter.' The OrcaRouter logo is composited in the bottom-right corner.

上述机制并非来自数据库中对某个句子的解读。它们就存在于 AgentScope 2.0.11 标签版本的源码中,并且发现该漏洞的人也以同样的措辞对其进行了描述。GitHub issue #3312 由化名为 ybyu-ieu 的研究人员于 2026 年 10 月 14 日提交,并被维护者标记为 triage/confirmed,该 issue 逐行梳理了这条路径:未经验证的 command 字段、_initialize_client() 的交接、从请求头解析身份的端点,以及 add_mcp() 立即建立连接。该 issue 称,这一缺陷最早于 2026 年 7 月 8 日通过 GitHub 的私有漏洞报告渠道私下上报,并且当时开启的公告——引用编号为 GHSA-h4fc-fmm3-h8hg——在研究于 2026 年 8 月 30 日核查时仍处于分类处理阶段,维护者未作任何回应;该公告标识符如今在 GitHub 的公告 API 中返回 404,因此无法从外部核实这一说法。

这个概念验证产生的是一个标记文件,而不是一次入侵。研究人员的报告(从 CVE 记录中作为漏洞利用参考链接过去)称,测试于 2026 年 7 月 8 日进行,针对的是从 PyPI 安装的 agentscope 2.0.4,运行在 Windows 11 主机上,示例 agent 服务在默认 LocalWorkspace 模式下绑定到 0.0.0.0:8000。该请求注册了一个 MCP,其命令为 cmd,参数会将一个标记字符串回显到文件中;HTTP 响应为 500 或超时,原因是 MCP 握手失败,而之后包含该标记的文件留在了磁盘上。第二位评论者以 Koawa265Richard31 的身份于 2026 年 10 月 15 日发帖称,他们在主分支上的一个真实部署中独立复现了该问题:注册了不带参数的 calc 并观察到计算器进程,然后又将 whoami 的输出重定向到文件。同一公开帖子上由两个账号完成两次复现,是对该机制的佐证;这并不能证明有人曾利用它攻击过不受自己控制的系统。

最后这一区分正是该记录评级的依据所在,值得直截了当地说明。已确立:该代码路径存在于已发布版本中,该端点不需要任何真实凭据,进程在任何握手之前即被启动,且没有可用的修复版本。未确立:任何在野利用、任何已暴露的 AgentScope 部署数量、任何维护者在公开讨论串中的声明,以及任何由维护者撰写而非从 CVE 导入的上游公告。NVD 对 CVE-2026-123022 的条目在 2026 年 11 月 9 日、即发布四天后带有“Deferred”状态,这意味着 NVD 尚未作出自己的分析。归档正是因此将其记录为置信度 B——有文档记录,但仅来自单一原始提交以及复制它的跟踪器。

四个分数和一个评级,全都源于同一个缺陷

HTML card titled 'Six dates and five scores, none of them a consensus', kicked 'CVE-2026-123022 · the record in dates' and subtitled 'Dates as published by GitHub issue #3312, PR #3448, PR #3329, PyPI and the CVE record. Scores are what each body assigned; no source in the record reconciles them.' Two columns run side by side. The left column, headed 'The dates' in cyan and subheaded 'Disclosure, reproduction, publication, and the fix that has not landed', carries six dated rows. 8 July 2026: the reporter says the flaw went to the maintainers through GitHub private vulnerability reporting as GHSA-h4fc-fmm3-h8hg, an identifier that now returns 404. 8 July 2026: proof of concept run against agentscope 2.0.4 on Windows 11 with the service on 0.0.0.0:8000, creating a marker file. 14 October 2026: GitHub issue #3312 opened publicly and labelled triage/confirmed, still open on 9 November. 23 October 2026: pull request #3448 opened — an opt-in stdio allowlist, default unchanged, no authentication, no sandbox — using 'Refs', not 'Fixes'. 27 October 2026: AgentScope 2.0.11 published on PyPI, still the newest version and the last one the CVE lists as affected. 5 November 2026: CVE-2026-123022 published by the VulDB CNA at 13:15 UTC and mirrored by NVD at 14:17 UTC with status Deferred. The right column, headed 'The scores' in amber and subheaded 'One flaw, five published numbers', lists six rows: CVSS 3.1 — 7.3 High, from the CVE record, NVD and GitHub's advisory database; CVSS 4.0 — 6.9 Medium, per the CVE record and OpenCVE; CVSS 4.0 — 5.5 Medium, as stored in NVD's own copy of the record; CVSS 2.0 — 7.5 High, a secondary score in the CVE record; Red Hat impact — Critical, with the note that AgentScope is not shipped in Red Hat Enterprise Linux; and the reporter's own vector — 9.8, proposed in the advisory and not adopted. A footer reads 'Dates and scores as published by the VulDB CVE record, NVD, OpenCVE, GitHub's advisory database, Red Hat, PyPI, AgentScope issue #3312 and PR #3448. Card rendered by OrcaRouter.' The OrcaRouter logo is composited in the bottom-right corner.

这些评分并不一致,而且这种不一致并非舍入差异。CVE 记录为 CVSS 3.1 指定的基础评分为 7.3,等级为高,其向量为 AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L——可通过网络访问、无需特权、无需用户交互,但对机密性、完整性和可用性的影响仅为低。同一记录为 CVSS 4.0 指定的基础评分为 6.9,等级为中。NVD 对该记录的副本为 CVSS 4.0 存储的是 5.5,等级为中。Red Hat 针对该 CVE 的页面则相反,将其评为严重(Critical)影响,并解释说“未经身份验证的网络用户能够以正在运行的应用程序的权限执行任意命令,从而导致主机的机密性、完整性和可用性被完全破坏”,同时补充说 AgentScope 并未包含在 Red Hat Enterprise Linux 或其他受支持的 Red Hat 发行版中,因此除非有人自行部署了该框架,否则默认的 Red Hat 部署不会受到影响。

如果你按字面解读 CVSS 3.1 向量,这场分歧中偏向低影响的一侧并非不合理:注入允许攻击者指定一个程序及其参数,但机密性、完整性和可用性影响被评为低而非高,这正是把 7.3 从报告者提出的 9.8 拉低的原因。报告者自己的公告也预见了另一种解读,指出如果维护者认定受影响的部署需要事先的管理员访问权限,那么所需权限指标就应调整,同一向量将评分为 8.8。记录中没有人对这一差异作出裁定。档案自身的严重性字段为高,而这又是另一项独立判断:记录解释说,其严重性评级针对的是已经发生的情况,因此一个属于未认证 RCE 类、但没有已知利用的漏洞会被记录为高而非严重。

该修复是一个尚未合并的拉取请求。

CVE 所指的补救措施是 agentscope-ai/agentscope 上的拉取请求 #3448,该请求由 Deepak-Khimavath 于 2026 年 10 月 23 日提交,截至 2026 年 11 月 9 日检查时仍处于打开、未审查且未合并状态。其描述本身谨慎说明了它做什么、不做什么。它增加了一个需显式启用的允许列表——create_app(..., allowed_stdio_commands=["npx", "uvx"])——当该列表被设置后,如果某个 stdio MCP 的命令不在其中,就会在工作区启动它之前以 403 拒绝。匹配是精确匹配,因此允许名称的带路径前缀变体或大小写不同的变体都无法通过。默认值为 None,这使行为保持不变,作者也明确说明了这一点:在默认情况下,“此端点的暴露程度与之前完全相同”。它不添加身份验证,也不对生成的进程进行沙箱隔离,并使用 Refs 而不是 Fixes 来关联该 issue,原因就在于此。

认证那一半是第二个拉取请求 #3329,同样处于打开且未合并状态,它添加了一个需主动启用的共享密钥门禁,该门禁由 AGENTSCOPE_API_KEY 环境变量驱动。综合这两者来看,截至 2026 年 11 月 9 日,已交付的框架状态是:其最新版本 2.0.11 包含该易受攻击的字段,而两项缓解措施都仍在等待人工决定合并并发布。对于这种规模的项目来说,这种模式并不罕见,这也是 CVE 描述以一句平淡的话收尾的原因:“修复此问题的拉取请求仍在等待接受”。

在此期间,运维人员能做的来自报告者而非厂商,而且全都是降低暴露面,而不是补丁。将 agent 服务绑定到 127.0.0.1,而不是 0.0.0.0。封堵 POST /workspace/mcp在网络层或反向代理层。完全禁用或限制对 MCP Workspace API 的外部访问。如果 stdio MCP 必须保持可用,就把服务放在被启动的进程无法触及任何有价值内容的位置,因为 Docker 和 E2B 工作区后端会将该进程限制在各自的沙箱内——报告者指出,命令仍会在那里执行,只是执行时处于隔离状态。Red Hat 的页面未记录任何符合其自身产品安全标准的缓解措施,这说明的是 Red Hat 的打包情况,而不是修复本身。

为什么公开的漏洞利用和空白的新闻周期可以同时成立

Abstract technical illustration on a dark navy field with a faint slate grid: on the left third a single small warm amber rectangular plane stands at a slight angle, glowing softly, with three thin concentric rings around it like emitted signal. From it, one thin pale beam travels horizontally to the right across a wide empty gap. On the right two thirds, a large regular array of identical flat panels recedes in perspective, all of them dark, matte, unlit and blank; the beam reaches them without brightening them, and a very faint pool of light sits on the nearest two panels only. No text, people or organisation logos appear. The OrcaRouter logo is composited in the bottom-right corner.

VulDB 的描述称“该漏洞利用现已公开,可能被使用”,这是关于披露状态的陈述,而非关于攻击的陈述。公开的漏洞利用是报告者自己撰写的、附带可复制粘贴复现步骤的文章,并与该问题一同发布;OpenCVE 的富化页面将其表述为“漏洞利用已活跃可用”,并用 FIRST 的 EPSS 评估利用可能性为 0.01638——即 1.6%,百分位为 76.5%——截至 2026 年 11 月 8 日。NVD 记录副本中的 CISA SSVC 决策点显示 利用情况:无,可自动化:是,技术影响:完全。没有 KEV 条目。档案据此记录 实际危害:否:存在任何人都能阅读的可用漏洞利用,且没有证据表明有人曾将其用于非自己拥有的系统。

独立报道正是缺失的那一部分。2026年11月8日和9日,针对该 CVE 标识符以及 AgentScope 工作区漏洞的搜索,未返回任何新闻报道、安全厂商博客或邮件列表讨论串。GitHub 自身的搜索只返回该议题和拉取请求,除此之外仅有其他执行每日安全公告扫描的项目。每一条数据库条目——NVD 的延期记录、OpenCVE 的页面、GitHub 的 GHSA-m997-8g56-6phf、Red Hat 的评估——要么复制 VulDB 的文本,要么只是复述它;它们都没有添加独立测试。GitHub 的安全公告条目值得准确点名,因为它看起来像记录中所说缺失的厂商公告:GHSA-m997-8g56-6phf 创建于 2026年11月5日,带有相同的 VulDB 描述,列出的严重性为“medium”,同时引用 CVSS 3.1 评分 7.3,并且有一个空的 github_reviewed_at 字段,这意味着 GitHub 尚未审查它。它是对该 CVE 的导入,而不是维护者声明。

这正是这份记录所处的空白,也正是快速演进的智能体基础设施中大多数漏洞披露的真实面貌。代码公开可读,缺陷在公开帖子中被演示了两次,存在一个 CVE 编号和四个彼此不一致的评分,而本可定论的东西——维护者公告、修复版本、NVD 分析、哪怕一篇独立新闻报道——都尚未出现。任何在可达接口上运行 AgentScope 智能体服务的人,现在都应把这种暴露视为真实存在,而不是等待书面材料,因为缺失的是书面材料,不是漏洞。