What happened
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 targets a repository outside the allowed path. A caller who can invoke the server's tools and place such a file in the allowed tree can read committed content from, and create branches in, a repository outside the configured boundary. CVSS 5.8 (CVSS 3.1).
Why it matters
The --repository restriction is the isolation boundary that keeps an LLM-agent's git MCP tools confined to an approved repository. This bypass lets an agent (or attacker directing it) read and write outside that boundary, breaking the sandboxed repository confinement and exposing unrelated code.
Attack vector
Local/agent-controlled — an agent with tool invocation can place a .git gitdir file in the allowed tree pointing to an outside repo, then read/commit to that repo.
Affected systems
mcp-server-git (modelcontextprotocol/servers) before 2026.10.28
Mitigation
Upgrade to 2026.10.28; enforce that resolved gitdir paths stay within the allowed repository root.