mcp-server-git: a repository's config-based hooks (Git 2.54+) run a program on git_status despite the hook hardening
GHSA-j4hr-p3xr-v32q · published 2026-12-05
- Severity
- High
- CVSS score
- 7.8
- Chance of exploitation (EPSS)
- No CVE
- Fixed in
- 2026.12.5
Opening a repository that came from somewhere else (an unpacked archive, a shared folder, a vendored tree) and calling git_status on it runs a command chosen by whoever prepared the repository, with the privileges of the server process. It needs Git 2.54 or later on the host; older Git ignores these keys.
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.
In harden_repo, list ^hook\..*\.(command|event)$ with --show-scope the way _LISTED_KEYS is listed, and for every name that comes from a scope other than system, global or command add hook. .enabled=false to the overrides. I did not test emptying command; hook. .enabled=false is documented and is what turned them off in the test above. If a repository reuses the name of one of the user's own hooks, this turns that hook off as well, which seems acceptable. A submodule's configuration would need the same treatment where the server already reads submodule drivers. The Git documentation also lists hook. …
| Package | Registry | Affected | Fixed in |
|---|---|---|---|
| mcp-server-git | PyPI | <= 2026.11.27 | 2026.12.5 |
- CriticalLiteLLM has SQL Injection in Proxy API key verificationlitellmExploited
- Criticaln8n Vulnerable to Remote Code Execution via Expression Injectionn8nExploited
- HighLiteLLM has a sandbox escape in custom-code guardraillitellmExploited
- HighLangflow affected by Remote Code Execution via validate_code() exec()langflowExploited
- CriticalJupyter MCP Server: Browser DNS rebinding can hijack the Jupyter backend through management routesjupyter-mcp-server
- Criticalmem0ai Databricks vector store vulnerable to SQL injectionmem0ai
- 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.