CVE-2025-68143: mcp-server-git's unrestricted git_init tool allows repository creation at arbitrary filesystem locations
Before 2025.9.25, the `git_init` tool in mcp-server-git (the MCP reference Git server) created a Git repository in any directory the server process could reach, with no path check. That turned arbitrary folders into targets for later Git tools. The fix removes `git_init` entirely. Upgrade to 2025.9.25.
Published Dec 17, 2025 · Updated Dec 20, 2025 · Analysis Nov 1, 2026
What an attacker can do
All other tools in mcp-server-git need an existing repository. git_init was the exception: it took a repo_path, called git.Repo.init(..., mkdir=True) and made a repository wherever the path pointed, creating missing folders too. The call_tool handler even ran init before the check for an existing repo.
The flaw alone only writes a .git directory. Its weight comes from what follows. A directory that is now a repository becomes valid input for the other tools, such as status, diff, checkout and show. An AI agent, or an attacker who steers it with a prompt injection, can therefore point the Git server at places like a home directory or a system path, which it could not do before. The same reporter found two further flaws in this server, covered by CVE-2025-68144 and CVE-2025-68145, that make those follow-up steps more powerful.
The CVSS vector lists passive user interaction and no direct impact on the server itself, but high impact on subsequent systems. The sources show no standalone code execution or data theft from this issue.
Who is affected
pip package mcp-server-git below 2025.9.25, in any setup where an MCP client can call git_init. Version 2025.9.25 and later no longer expose the tool.
pip show mcp-server-gitIf you launch it with uvx mcp-server-git, check which version your MCP client config resolves.
mcp-server-git
- Ecosystem
- PyPI
- Affected
- < 2025.9.25
- Fixed in
- 2025.9.25
- Check
pip show mcp-server-git
How to fix it
Upgrade to mcp-server-git 2025.9.25 or later:
pip install --upgrade "mcp-server-git>=2025.9.25"The fix commit removes the GitInit model, the git_init enum value, the function and its registration. The server now works on existing repositories only. The sources list no workaround. Take 2025.12.18 or later if you can, since that release also fixes the two newer Git server flaws.
How to tell if you were hit
Look for git_init tool calls in your MCP client logs. On disk, look for .git directories in places that are not projects, such as home folders, /tmp or system paths, created by the user running the MCP server. Beam records the MCP tool calls an agent makes, and a rule on git_init calls would flag the event.
Original advisory
From the GitHub Advisory Database (CC BY 4.0).
In mcp-server-git versions prior to 2025.9.25, the git_init tool accepted arbitrary filesystem paths and created Git repositories without validating the target location. Unlike other tools which required an existing repository, git_init could operate on any directory accessible to the server process, making those directories eligible for subsequent git operations. The tool was removed entirely, as the server is intended to operate on existing repositories only. Users are advised to upgrade to 2025.9.25 or newer to remediate this issue.
Thank you to https://hackerone.com/yardenporat for disclosure, @0dd for contributing the fix.
Questions
- Was git_init patched or removed?
Removed. The fix commit deletes the tool, because the server is meant to operate on existing repositories only.
- Does CVE-2025-68143 give code execution?
The sources do not say so. The flaw creates repositories at arbitrary paths, which makes those paths eligible for later Git tool calls.
- Is 2025.9.25 enough?
It fixes this CVE. Two other flaws in the same server, CVE-2025-68144 and CVE-2025-68145, are fixed in 2025.12.18, so use that or newer.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. The analysis is written by an AI model from the sources listed above and checked by automated rules before it is published. Check versions against the vendor's advisory before you act. Methodology
More MCP reference servers vulnerabilities
All MCP reference servers entriesCVE-2026-27735
mcp-server-git : Path traversal in git_add allows staging files outside repository boundaries
medium6.4Feb 26, 2026CVE-2025-68144
mcp-server-git argument injection in git_diff and git_checkout functions allows overwriting local files
medium6.3Dec 17, 2025CVE-2025-68145
mcp-server-git has missing path validation when using --repository flag
medium6.4Dec 17, 2025CVE-2025-53109
@modelcontextprotocol/server-filesystem allows for path validation bypass via prefix matching and symlink handling
high7.3No fixJul 1, 2025CVE-2025-53110
@modelcontextprotocol/server-filesystem vulnerability allows for path validation bypass via colliding path prefix
high7.3No fixJul 1, 2025
