UTC
Medium

mcp-server-git: with `--repository`, a concurrent rewrite of `.git/config` (`core.worktree`) after the opening check redirects the tool's gi

GHSA-74v6-p7q4-hj96 · published 2026-12-05

Severity
Medium
CVSS score
Not scored
Chance of exploitation (EPSS)
No CVE
Fixed in
2026.12.5
What it is

GHSA-5pwg-5xfw-x322 described a caller who can use a git tool and the Filesystem server's write_file rewriting objects/info/alternates after the repository check. The fix (PR #5677) gives each call its own object directory. I see the same kind of window for .git/config, and I would like to know whether you consider it in scope. Tested at v2.6.0, commit b502fd9f, which was also origin/main when I checked on 2026-11-28, with the server started as --repository R and O a directory outside R whose path the caller knows. …

What to do

Upgrade mcp-server-git to 2026.12.5 or later. If you start it from an MCP config with npx or uvx, pin that version so an old cached copy is not used.

After the opening validation succeeds, pin what it resolved for the rest of the call: GIT_DIR to the validated git directory and, for a repository that is not bare, GIT_WORK_TREE to the validated top level, keeping the existing checks after the call's own writes. PR #5627 considered pinning the location keys and decided against it because it "would change how git resolves the working tree for linked worktrees and bare repositories". Pinning the values git has just resolved for this repository might avoid that, but I have not tested it, and I would treat linked worktrees and bare repositories as the acceptance cases.

Affected
PackageRegistryAffectedFixed in
mcp-server-gitPyPI<= 2026.11.272026.12.5

The impact, patch and workaround text comes from the advisory, shortened (published by the MCP reference servers project). Proof-of-concept and reproduction sections and code are left out; the original advisory has them.

Sources: GitHub Advisory Database, reviewed and malware advisories (CC BY 4.0, https://github.com/advisories); advisories published by Cursor (https://github.com/cursor/cursor/security/advisories); advisories published by OpenClaw (https://github.com/openclaw/openclaw/security/advisories); advisories published by vLLM (https://github.com/vllm-project/vllm/security/advisories); advisories published by Open WebUI (https://github.com/open-webui/open-webui/security/advisories); advisories published by n8n (https://github.com/n8n-io/n8n/security/advisories); advisories published by Flowise (https://github.com/FlowiseAI/Flowise/security/advisories); advisories published by Langflow (https://github.com/langflow-ai/langflow/security/advisories); advisories published by the MCP Python SDK project (https://github.com/modelcontextprotocol/python-sdk/security/advisories); advisories published by the MCP reference servers project (https://github.com/modelcontextprotocol/servers/security/advisories); advisories published by the MCP Inspector project (https://github.com/modelcontextprotocol/inspector/security/advisories); advisories published by the MCP TypeScript SDK project (https://github.com/modelcontextprotocol/typescript-sdk/security/advisories); advisories published by the MCP Go SDK project (https://github.com/modelcontextprotocol/go-sdk/security/advisories); advisories published by the MCP Java SDK project (https://github.com/modelcontextprotocol/java-sdk/security/advisories); advisories published by the MCP Kotlin SDK project (https://github.com/modelcontextprotocol/kotlin-sdk/security/advisories); advisories published by the MCP Rust SDK project (https://github.com/modelcontextprotocol/rust-sdk/security/advisories); advisories published by the MCP Ruby SDK project (https://github.com/modelcontextprotocol/ruby-sdk/security/advisories); advisories published by the MCP C# SDK project (https://github.com/modelcontextprotocol/csharp-sdk/security/advisories); advisories published by the MCP PHP SDK project (https://github.com/modelcontextprotocol/php-sdk/security/advisories); advisories published by the MCP Registry project (https://github.com/modelcontextprotocol/registry/security/advisories); advisories published by Open Terminal (https://github.com/open-webui/open-terminal/security/advisories); advisories published by MLflow (https://github.com/mlflow/mlflow/security/advisories); CISA Known Exploited Vulnerabilities catalog (CC0). Data as of 2026-12-06. ShieldMap describes how each problem works and how to fix it; it does not publish exploit code. Report a correction to [email protected].