Repository navigation
fix(security): block Git helpers in read-only MCP tools - #2669
groupthinking wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
TEST — verified read-tool repair receipt, 2026-11-13Notification decision: YES. A new custom-server security failure was independently reproduced and a tested fix is now reviewable. This is not a routine release alert. Objective, impact and exact inputsPrevent repository-configured helper execution from the active custom MCP git_status/git_diff tools. Parent #2349 stays open; child #2668 covers this repair.
Primary signal: GHSA-6hqx-gqrx-c5r2, published November 11. It concerns a separate reference implementation; no shared product identity or assigned CVE is claimed here. Confidence in this custom reproduction: 0.99. Risk requires hostile/preserved/altered local .git/config; a plain clone does not copy the remote config. Exact mutation and verificationRead paths disable fsmonitor, pager, external diff and textconv; dirty submodule inspection is reduced. Explicit write paths are preserved. No manifest, credential, permission or deployment change. VERIFIED locally: Node 24.22.1 / Git 2.52.0 / Python 3.12.14. VERIFIED actual MCP stdio integration: exact baseline/patched source files, isolated SDK 1.32.2 installed with VERIFIED hosted exact-head:
Remaining responsibility and closureCodex owns safe follow-through and any new current-head CI/review failure. Merge is BLOCKED solely on Hayden's explicit approval of PR #2669/head 87eda70. On approval, Codex must freshly verify head, checks, reviews/threads and mergeability, use expected-head protection, then fetch the merge commit and verify applicable post-merge checks. No merge or production deployment occurred. Independent open gates remain separately owned by Codex:
Audit and continuationNeon observation 364; action 181 retains initial attempts and this follow-through. Failed helper initialization (btoa unavailable) made no filesystem write; replaced safely. A readback query used id instead of action_id and failed 42703; schema inspection corrected it, no database mutation from the failed query. Correction to the initial receipt wording: one connector read returned no parseable content and the local JSON parse failed; its cause is UNKNOWN. The next call used only documented arguments and exact readback succeeded. Do not infer connector rejection from a missing field without an explicit provider error. The first atomic ledger update then failed 23502 because a linked incorrect_claim_id was required; it rolled back. The correction was recorded with linked claims after schema inspection. No false completion claim resulted. |
Closes #2668
Refs #2349 (parent remains open).
Verified problem and bounded repair
At base 512a255 the active repository config points at tools/mcp/git_workflow_server.mjs. Its status/diff functions spawn Git with the repository configuration intact. A harmless offline reproduction executed marker helpers through core.fsmonitor, diff.external and textconv. This applies to repositories arriving with a hostile .git/config or altered local configuration; a plain clone does not copy the remote .git/config.
Related primary evidence: GHSA-6hqx-gqrx-c5r2, published November 11, 2026, describes the same class in the separate reference Python server. It does not assign a vulnerability identifier to this custom implementation.
The patch passes --no-pager and core.fsmonitor=false for the two read tools, disables external diffs/textconv explicitly, and ignores dirty submodule inspection. Submodule working-tree detail is intentionally reduced; commit-pointer differences remain visible. Explicit add/commit/push/pull behavior is preserved. This is not a complete Git sandbox, write authorization layer, credential-containment fix or the full #2349 scope.
Executed verification
Node 24.22.1, Git 2.52.0, Python 3.12.14. Seven scenarios execute the exact source function bodies in a Node VM against actual temporary Git repositories. The seven-case regression evaluates functions without transport. A separate actual SDK 1.32.2 stdio test negotiated protocol 2025-11-25: baseline tools/call executed fsmonitor, external-diff and textconv marker helpers; patched tools/call executed none, with successful responses and exit 0. Allowlisted child environment contains only PATH, HOME and GIT_CONFIG_NOSYSTEM; helpers only write a local marker.
Complete runnable recipe
Prerequisites: Git, Node 22+ and Python 3.11/3.12; no SDK install, keys, provider calls or paid service. ESTIMATE: 5–10 minutes excluding CI.
git fetch origin codex/git-mcp-read-helper-guard-20261113;git worktree add --detach /tmp/eventrelay-read-guard 87eda70c7cc557ad9d967c83ac81cca6ec90162c;cd /tmp/eventrelay-read-guard.python tests/unit/test_git_read_only_security.py; expected one unittest OK with all seven scenarios passing.node tests/security/git_workflow_read_only_probe.mjs tools/mcp/git_workflow_server.mjs; expected seven PASS lines and exit0.node --check tools/mcp/git_workflow_server.mjsandgit diff --check.git show 512a2558f73d6281b6a880548bedf140b7e30292:tools/mcp/git_workflow_server.mjs > /tmp/git-workflow-baseline.mjs, then run the same probe against that file. Expected six FAIL lines and one PASS, exit1. Only temporary fixture repositories are modified.Codex owns terminal CI/review follow-through and safe repairs. Exact PR/head approval is required before merge. No permission expansion, paid call, production deployment, remote Git operation or secrets access. Workflow value: read-oriented agent inspection cannot trigger these repository-configured helpers. A supervised local MCP audit is a potential service deliverable; revenue/savings are unmeasured.