Gortex 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"
internal/mcp/tools_fileops.go (+ tools_move_inline.go), HEAD 28fa017 (v0.53.0).
CWE-22 (Path Traversal) / CWE-73 (External Control of File Name/Path) → CWE-94 (code execution).
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.
The 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:
=== RUN TestPoC_ArbitraryWrite_AbsolutePathEscapesEveryRepoRoot
indexed repo root (confinement boundary): /var/folders/.../myrepo
handler status=created path=/var/folders/.../003/pwn.txt bytes_written=50
PROOF: /var/folders/.../003/pwn.txt now exists with attacker bytes "OWNED-by-gortex-write_file-outside-every-repo-root"
RCE-PATH PROOF: wrote /var/folders/.../004/victim-home/.zshrc (parent dir...
0.55.0Exploitability
AV:LAC:LPR:NUI:RScope
S:UImpact
C:HI:HA:H7.8/CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:HInput Validation