mcp-server-git: a config include created by the merged branch runs a command during git_merge
GHSA-9vjp-x34c-xg6v · published 2026-11-18
- Severity
- High
- CVSS score
- 7.8
- Chance of exploitation (EPSS)
- No CVE
- Fixed in
- 2026.11.18
Arbitrary command execution as the user running the MCP server. The preconditions are narrower than GHSA-6hqx-gqrx-c5r2, so they are worth stating exactly: The attacker supplies a repository with an attacker-written .git/config: an archive, a shared folder, a copied workspace. A plain clone does not carry it. That repository has a branch which adds the included file and conflicts with the current branch. Someone calls git_merge on that branch with fast_forward_only=false. That is not the default, but it is the documented way to merge diverged branches. --repository confinement does not help. The tool's response looks like an ordinary merge conflict.
Upgrade mcp-server-git to 2026.11.18 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.
With this change the exploit legs stop running the payload, whether or not the separate empty-driver-name issue is also fixed, and git_merge still reports the conflict and leaves the repository clean. A broader option is to refuse repository-scope include.path and includeIf.*.path in harden_repo. That covers any future tool that changes the working tree and then runs git again. We did not test it.
Do not merge branches of repositories you received from someone else, or do it in a fresh clone where the .git/config is the one git wrote. Run the server as a user without credentials that matter. Require approval for git_merge specifically. The read-only tools are not affected here.
| Package | Registry | Affected | Fixed in |
|---|---|---|---|
| mcp-server-git | PyPI | >= 2026.11.4, < 2026.11.18 | 2026.11.18 |
- CriticalUnauthenticated Remote Code Execution in Langflow via Public Flow Build EndpointlangflowExploited
- CriticalRay is vulnerable to Critical RCE via Safari & Firefox Browsers through DNS Rebinding AttackrayExploited
- CriticalLangflow Unauth RCElangflow, langflow-baseExploited
- HighLiteLLM: Authenticated command execution via MCP stdio test endpointslitellmExploited
- CriticalMLflow vulnerable to remote code execution on unauthenticated servers via third-party scorer deserialization importing caller-placed artifacmlflow
- CriticalAgno: Arbitrary code execution via `eval()` on `field_type` in `FunctionCall`agno
- Criticalmcp-server-git runs a repo's gpg.program via git_merge and git_branchmcp-server-git
- Criticalgit_add runs submodule filter commands when gitlink mode is not 160000mcp-server-git
- Criticalmcp-server-git: unexpandable sparse index lets submodule filter drivers runmcp-server-git
- Criticalgit: harden_repo ignores core.worktree, so repository-defined filters runmcp-server-git
- Criticalmcp-server-git --repository: checks a bare repo but runs a hidden .git's filtermcp-server-git
- Highgit: index entries under a symlink leak files outside --repositorymcp-server-git
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.