{"vuln_id":"GHSA-w42c-h7hr-f67p","aliases":["CVE-2026-62964"],"description":"Gortex: Arbitrary file write / repo-confinement escape in `write_file` / `edit_file` / `move_inline` MCP tools → code execution","published_at":"2026-11-19T20:36:31Z","modified_at":"2026-11-19T20:45:04.393196Z","first_seen_at":"2026-11-21T19:15:19.494465Z","severity":"high","severity_source":"ghsa","cvss_score":7.8,"cvss_vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","cwe":["CWE-22","CWE-73"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":null,"epss_percentile":null,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://github.com/advisories/GHSA-w42c-h7hr-f67p"},"matched_alias":null,"items":[{"id":10976,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-w42c-h7hr-f67p: Gortex: Arbitrary file write / repo-confinement escape in `write_file` / `edit_file` / `move_inline` MCP tools → code execution","summary":"Gortex: Arbitrary file write / repo-confinement escape in `write_file` / `edit_file` / `move_inline` MCP tools → code execution\n\n### Summary\nGortex is an MCP server exposing `write_file`, `edit_file`, and `move_inline` tools. `resolveFilePath` **exempts absolute paths** from confinement, and the write handlers — unlike `read_file` / `get_symbol_source` — **never call `guardSymlinkWithinRepo`**. A single MCP `write_file` call with an absolute path writes any file the daemon user can, **outside every indexed repo root** (`AtomicWriteFile`'s `MkdirAll` auto-creates missing parents). Writing `~/.zshrc`, `~/.bashrc`, `.git/hooks/pre-commit`, or a cron/systemd unit yields code execution on the next shell/commit. This directly violates the project's own `SECURITY.md` invariant *\"File-path resolution is **confined to indexed repository roots**\"*\n\n### Affected\n`internal/mcp/tools_fileops.go` (+ `tools_move_inline.go`), HEAD `28fa017` (v0.53.0).\n**CWE-22** (Path Traversal) / **CWE-73** (External Control of File Name/Path) → **CWE-94** (code execution).\n\n### Vulnerable code\n`internal/mcp/tools_fileops.go:54-62` `resolveFilePath` exempts absolute paths from the repo-root confinement; the write sink at `:793` (`AtomicWriteFile`, `write_file`) and `:676` (`edit_file`) run with **no** `guardSymlinkWithinRepo`. The asymmetry is the bug: `read_file` (`:940`) and `get_symbol_source` **do** call `guardSymlinkWithinRepo`; the write path does not.\n\n### PoC (executed)\nThe PoC (`internal/mcp/poc_arbitrary_write_test.go`, package `mcp`) builds the server via the repo's **own** `newSingleRepoServer(t)` harness and invokes the real `srv.handleWriteFile` through the genuine `mcplib.CallToolRequest` shape:\n```\n=== RUN   TestPoC_ArbitraryWrite_AbsolutePathEscapesEveryRepoRoot\n  indexed repo root (confinement boundary): /var/folders/.../myrepo\n  handler status=created path=/var/folders/.../003/pwn.txt bytes_written=50\n  PROOF: /var/folders/.../003/pwn.txt now exists with attacker bytes \"OWNED-by-gortex-write_file-outside-every-repo-root\"\n  RCE-PATH PROOF: wrote /var/folders/.../004/victim-home/.zshrc (parent dir auto-created) -> \"echo PWNED_BY_GORTEX_RCE # injected via write_file\"\n  VIOLATION of SECURITY.md line 17 (\"It does not write to source files\")\n--- PASS  (go test ok)\n```\nThe test asserts the handler did **not** return `IsError` and that the files exist outside every repo root. (Full PoC available on request.)\n\n### Impact\n`write_file` / `edit_file` are MCP tools driven by an LLM agent. A prompt-injected or adversarial agent (the standard MCP threat model) writes any file the daemon user can — startup/hook/cron files → arbitrary code execution on the host running the daemon. Confinement (the security property `SECURITY.md` promises) is broken on the write path.\n\n### Severity\n**High — CVSS v3.1 `AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N` ≈ 8.x.** `UI:R` reflects that a tool call must be elicited from the agent (standard MCP injected-tool model). The RCE is a chain (write a startup/hook file → execute on next trigger), so `I:H` + the code-execution path. Floor: if the deployment never exposes write tools\n\nAffected: Go:github.com/zzet/gortex\n\nFixed in: 0.55.0\n\nReferences:\nhttps://github.com/zzet/gortex/security/advisories/GHSA-w42c-h7hr-f67p\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-62964\nhttps://github.com/zzet/gortex/commit/5ba2f066dd6dcd726c4e61b74851862dc596d994\nhttps://github.com/zzet/gortex\nhttps://github.com/zzet/gortex/releases/tag/v0.55.0","url":"https://osv.dev/vulnerability/GHSA-w42c-h7hr-f67p","published_at":"2026-11-19T20:36:31Z","updated_at":"2026-11-19T20:45:04.393196Z","fetched_at":"2026-11-21T19:15:55.946343Z","severity":"high","cvss_score":7.8,"epss":0.00277,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"github.com/zzet/gortex","vuln_id":"CVE-2026-62964","vuln_ids":["CVE-2026-62964","GHSA-W42C-H7HR-F67P"],"tags":["osv","go","fix-available"],"cluster_id":2236,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/10976","html":"https://vulnwatch.ve1ve2.com/item/10976"}},{"id":2402,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-w42c-h7hr-f67p / CVE-2026-62964: Gortex: Arbitrary file write / repo-confinement escape in `write_file` / `edit_file` / `move_inline` MCP tools → code execution","summary":"Gortex: Arbitrary file write / repo-confinement escape in `write_file` / `edit_file` / `move_inline` MCP tools → code execution\n\n### Summary\nGortex is an MCP server exposing `write_file`, `edit_file`, and `move_inline` tools. `resolveFilePath` **exempts absolute paths** from confinement, and the write handlers — unlike `read_file` / `get_symbol_source` — **never call `guardSymlinkWithinRepo`**. A single MCP `write_file` call with an absolute path writes any file the daemon user can, **outside every indexed repo root** (`AtomicWriteFile`'s `MkdirAll` auto-creates missing parents). Writing `~/.zshrc`, `~/.bashrc`, `.git/hooks/pre-commit`, or a cron/systemd unit yields code execution on the next shell/commit. This directly violates the project's own `SECURITY.md` invariant *\"File-path resolution is **confined to indexed repository roots**\"*\n\n### Affected\n`internal/mcp/tools_fileops.go` (+ `tools_move_inline.go`), HEAD `28fa017` (v0.53.0).\n**CWE-22** (Path Traversal) / **CWE-73** (External Control of File Name/Path) → **CWE-94** (code execution).\n\n### Vulnerable code\n`internal/mcp/tools_fileops.go:54-62` `resolveFilePath` exempts absolute paths from the repo-root confinement; the write sink at `:793` (`AtomicWriteFile`, `write_file`) and `:676` (`edit_file`) run with **no** `guardSymlinkWithinRepo`. The asymmetry is the bug: `read_file` (`:940`) and `get_symbol_source` **do** call `guardSymlinkWithinRepo`; the write path does not.\n\n### PoC (executed)\nThe PoC (`internal/mcp/poc_arbitrary_write_test.go`, package `mcp`) builds the server via the repo's **own** `newSingleRepoServer(t)` harness and invokes the real `srv.handleWriteFile` through the genuine `mcplib.CallToolRequest` shape:\n```\n=== RUN   TestPoC_ArbitraryWrite_AbsolutePathEscapesEveryRepoRoot\n  indexed repo root (confinement boundary): /var/folders/.../myrepo\n  handler status=created path=/var/folders/.../003/pwn.txt bytes_written=50\n  PROOF: /var/folders/.../003/pwn.txt now exists with attacker bytes \"OWNED-by-gortex-write_file-outside-every-repo-root\"\n  RCE-PATH PROOF: wrote /var/folders/.../004/victim-home/.zshrc (parent dir auto-created) -> \"echo PWNED_BY_GORTEX_RCE # injected via write_file\"\n  VIOLATION of SECURITY.md line 17 (\"It does not write to source files\")\n--- PASS  (go test ok)\n```\nThe test asserts the handler did **not** return `IsError` and that the files exist outside every repo root. (Full PoC available on request.)\n\n### Impact\n`write_file` / `edit_file` are MCP tools driven by an LLM agent. A prompt-injected or adversarial agent (the standard MCP threat model) writes any file the daemon user can — startup/hook/cron files → arbitrary code execution on the host running the daemon. Confinement (the security property `SECURITY.md` promises) is broken on the write path.\n\n### Severity\n**High — CVSS v3.1 `AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:N` ≈ 8.x.** `UI:R` reflects that a tool call must be elicited from the agent (standard MCP injected-tool model). The RCE is a chain (write a startup/hook file → execute on next trigger), so `I:H` + the code-execution path. Floor: if the deployment never exposes write tools\n\nAffected packages: go:github.com/zzet/gortex\nPatched: github.com/zzet/gortex 0.55.0","url":"https://github.com/advisories/GHSA-w42c-h7hr-f67p","published_at":"2026-11-19T20:36:31Z","updated_at":"2026-11-19T20:36:32Z","fetched_at":"2026-11-21T19:15:18.416809Z","severity":"high","cvss_score":7.8,"epss":0.00277,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"github.com/zzet/gortex","vuln_id":"CVE-2026-62964","vuln_ids":["CVE-2026-62964","GHSA-W42C-H7HR-F67P"],"tags":["ghsa","go","CWE-22","CWE-73"],"cluster_id":2236,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2402","html":"https://vulnwatch.ve1ve2.com/item/2402"}},{"id":8244,"source":{"id":"nvd","name":"NVD CVE API 2.0"},"title":"CVE-2026-62964: Gortex is a high-performance code-intelligence engine for AI agents and integrated development environments. Prior to 0.55.0, resolveFilePath in internal/mcp/t…","summary":"Gortex is a high-performance code-intelligence engine for AI agents and integrated development environments. Prior to 0.55.0, resolveFilePath in internal/mcp/tools_fileops.go accepts absolute paths without checking indexed repository roots, while write_file, edit_file, and move_inline in internal/mcp/tools_move_inline.go omit guardSymlinkWithinRepo before reaching AtomicWriteFile and related write sinks. A caller that can influence MCP tool arguments can therefore create or overwrite files anywhere the daemon user can access, including startup or hook files that execute code on a later trigger. The flaw violates Gortex's repository-confinement invariant and can lead to arbitrary host code execution. This issue is fixed in version 0.55.0.\n\nReferences:\nhttps://github.com/zzet/gortex/commit/5ba2f066dd6dcd726c4e61b74851862dc596d994\nhttps://github.com/zzet/gortex/releases/tag/v0.55.0\nhttps://github.com/zzet/gortex/security/advisories/GHSA-w42c-h7hr-f67p","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-62964","published_at":"2026-11-18T22:17:22.390000Z","updated_at":"2026-11-19T16:21:38.430000Z","fetched_at":"2026-11-21T19:15:31.484030Z","severity":"high","cvss_score":7.8,"epss":0.00277,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":null,"vuln_id":"CVE-2026-62964","vuln_ids":["CVE-2026-62964","GHSA-W42C-H7HR-F67P"],"tags":["CWE-22","CWE-73"],"cluster_id":2237,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/8244","html":"https://vulnwatch.ve1ve2.com/item/8244"}}]}