CVE-2025-68145 mcp-server-git has missing path validation when using --repository flag
Attackers can access or modify unauthorized Git repositories by bypassing path restrictions in the mcp-server-git tool when configured with a specific repository flag.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Over the internet
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2025-68145?
CVE-2025-68145 is a medium-severity path traversal vulnerability in modelcontextprotocol servers, published on 17 Dec 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Official description
In mcp-server-git versions prior to 2025.12.17, when the server is started with the --repository flag to restrict operations to a specific repository path, it did not validate that repo_path arguments in subsequent tool calls were actually within that configured path. This could allow tool calls to operate on other repositories accessible to the server process. The fix adds path validation that resolves both the configured repository and the requested path (following symlinks) and verifies the requested path is within the allowed repository before executing any git operations. Users are advised to upgrade to 2025.12.17 upon release to remediate this issue.
Weakness: CWE-22
Which versions are affected by CVE-2025-68145?
3 open source packages ship an affected version, including mcp-server-git. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
mcp-server-git PyPI | All versions | 2025.12.18 |
mcp-server-git PyPI | All versions | 2025.12.18 |
mcp-server-git PyPI | All versions | 2025.12.18 |
Products include Lfprojects Model Context Protocol Servers.
How do I fix CVE-2025-68145?
Upgrade mcp-server-git to 2025.12.18 or later.
Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.
Is CVE-2025-68145 being exploited?
There is no known exploitation of CVE-2025-68145 in the wild and no public exploit code.
Other vulnerabilities in modelcontextprotocol servers
- CVE-2025-68143 mcp-server-git's unrestricted git_init tool allows repository creation at arbitrary filesystem locations
- CVE-2026-27735 mcp-server-git : Path traversal in git_add allows staging files outside repository boundaries
- CVE-2025-68144 mcp-server-git argument injection in git_diff and git_checkout functions allows overwriting local files
Sources
Also known as GHSA-j22h-9j4x-23w5, MINI-42c5-m8rr-5442, PYSEC-2026-1623.