The vulnerability exists in the mcp-server-git package, specifically within the git_init tool. The root cause is the lack of input validation on the repo_path parameter provided to the git_init function. This function, as its name suggests, initializes a new Git repository. However, it did so at any path provided to it, without restricting the location to a designated directory. This created a path traversal vulnerability (CWE-22), allowing an attacker to create a Git repository anywhere on the filesystem that the server process had write permissions to. The call_tool function served as the entry point, dispatching the request to the vulnerable git_init function when the tool name git_init was supplied. The patch remediates this vulnerability by completely removing the git_init tool, including the GitInit data class, the git_init function itself, and the corresponding handling logic within the call_tool and list_tools functions. This ensures that the server can only operate on pre-existing repositories.
git_initsrc/git/src/mcp_server_git/server.py
call_toolsrc/git/src/mcp_server_git/server.py
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| mcp-server-git | pip | < 2025.9.25 | 2025.9.25 |
A Semantic Attack on Google Gemini - Read the Latest Research