mcp-server-git --repository restriction bypassed via nested gitdir file (CVE-2026-134465)
Summary
In mcp-server-git before 2026.10.28, the --repository restriction can be bypassed with a nested directory containing a .git file whose gitdir pointer names a repository outside the allowed path. The caller must be able to invoke the server's tools, place such a file in the allowed tree, and know the path of an outside repository that the MCP process can access. That caller can then read committed content from that repository and create branches in it. The project advisory says this is not claimed to be an unauthenticated standalone remote exploit.
Severity
Timeline
The issue was reported to the modelcontextprotocol/servers project.
The project published its advisory, which labels the issue Moderate and lists 2026.10.28 as the patched version.
GitHub advisory GHSA-7f33-9hc8-6cr8 for CVE-2026-134465 was published and labels the issue medium.
How it happened
With --repository set, validate_repo_path() accepts a nested directory because its path is inside the allowed repository. open_repo() then passes it to git.Repo(), which follows the .git file's gitdir pointer. The reporter confirmed that git_show returned committed content from the outside repository and that git_create_branch created a branch in it. The reporter confirmed package version 2026.10.19 and two source commits and did not assess other versions. The advisory lists all versions before 2026.10.28 as affected.
How to check your app
- all affected versions: Check which mcp-server-git version is installed. The advisory lists versions before 2026.10.28 as affected.
- before 2026.10.28: If the server runs with --repository, look for nested directories inside the allowed repository that contain a .git file with a gitdir pointer to a path outside it.
- before 2026.10.28: Check whether other tools, such as a filesystem MCP server, can write files into the allowed directory. That is one way the precondition can be met.
Sources
Corrections and updates
Cite this entry
- Title
- mcp-server-git --repository restriction bypassed via nested gitdir file (CVE-2026-134465)
- Added
- Nov 23, 2026
- URL
- https://vibeincidents.com/incidents/mcp-server-git-cve-2026-134465/
- Suggested citation
VibeIncidents. "mcp-server-git --repository restriction bypassed via nested gitdir file (CVE-2026-134465)." Nov 23, 2026. https://vibeincidents.com/incidents/mcp-server-git-cve-2026-134465/