The vulnerability is a path traversal issue in mcp-server-git. When the server is started with a --repository flag to restrict file operations to a specific directory, this restriction was not enforced. The call_tool function in src/git/src/mcp_server_git/server.py is responsible for handling all git-related tool calls. This function receives a repo_path argument from the client. In vulnerable versions, this repo_path was used to instantiate a git.Repo object without being validated against the configured repository path. This allowed an attacker to specify a path to any git repository on the server's filesystem, bypassing the intended restriction. The vulnerability was fixed by introducing the validate_repo_path function and calling it at the beginning of call_tool to ensure the requested repo_path is within the allowed directory. Therefore, call_tool is the vulnerable function as it's the entry point for the malicious input and where the security check was missing.
mcp_server_git.server.serve.<locals>.call_toolsrc/git/src/mcp_server_git/server.py
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| mcp-server-git | pip | <= 2025.11.25 |
A Semantic Attack on Google Gemini - Read the Latest Research