Gortex MCP 服务器 0.55.0 之前版本存在任意文件写入漏洞,可逃逸仓库限制执行代码
Gortex: Arbitrary file write / repo-confinement escape in `write_file` / `edit_file` / `move_inline` MCP tools → code execution
AI 导读
Gortex 是一个暴露 write_file、edit_file、move_inline 工具的 MCP 服务器,0.55.0 之前的版本存在仓库限制逃逸漏洞(GHSA-w42c-h7hr-f67p / CVE-2026-62964)。resolveFilePath 豁免绝对路径,写处理器又不像 read_file、get_symbol_source 那样调用 guardSymlinkWithinRepo,一次带绝对路径的 write_file 调用即可在所有索引仓库根之外写入守护进程用户可写的任意文件;写入 ~/.zshrc、.git/hooks/pre-commit 或 cron/systemd 单元可在下次 shell 或提交时执行代码。这些工具由 LLM 智能体驱动,被提示注入的智能体即可触发。
推荐理由
写路径缺少读路径已有的边界校验是根因,自建 MCP 文件写入工具的团队可对照检查读写守卫是否对称。