Hard-linked Git reflog escapes repository confinement
GHSA-m7x8-g56j-mf4q · published 2026-12-05
- Severity
- High
- CVSS score
- 7.0
- Chance of exploitation (EPSS)
- No CVE
- Fixed in
- 2026.12.5
An attacker who supplies an archive can cause the importing user to append a commit message to a writable host file outside the configured repository. When a client adopts the archive candidate returned by the commit-message prompt, the appended reflog entry can modify a shell startup file; the tested interactive Bash startup executed a canary as the Git server process user. The evidence does not show privilege escalation beyond that account, and it does not claim that every MCP host or model follows untrusted content. …
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.
During Git metadata validation, reject regular files in .git whose inode has an alias outside the configured repository. Apply this check to every writable metadata path GitPython may append to, including .git/logs/HEAD, without following attacker-controlled symlinks. Revalidate immediately before writes if metadata can change between validation and use. Add a regression test that imports an archive with .git/logs/HEAD hard-linked to a writable file outside the repository, then verifies that git_add and git_commit reject the repository without modifying the outside file. Keep a normal-reflog control and exercise the supported extraction path.
| Package | Registry | Affected | Fixed in |
|---|---|---|---|
| mcp-server-git | PyPI | 2026.11.27 | 2026.12.5 |
- CriticalMCP Path Traversal Allows Full-Filesystem Read and JWT Secret Exfiltration Leading to Account Takeoverlangflow, langflow-base
- CriticalVibe-Trading FastAPI endpoints permit unauthenticated access, file upload, and an RCE chainvibe-trading-ai
- Critical@zereight/mcp-gitlab: Unauthenticated arbitrary file read via `upload_markdown` enables PAT exfiltration and full account takeover@zereight/mcp-gitlab
- CriticalFlowise RCE via SQL Database Chain Nodeflowise, flowise-components
- CriticalLangroid: SQLChatAgent dangerous-function blocklist can be bypassed with quoted or schema-qualified pg_read_file callslangroid
- Criticalfast-mcp-telegram: Bearer token path traversal bypasses reserved Telegram session protectionfast-mcp-telegram
- 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.