# CVE-2025-68144: mcp-server-git argument injection in git_diff and git_checkout functions allows overwriting local files

> Attackers can overwrite local files by injecting command-line flags into git_diff and git_checkout functions in the MCP Git server.

- **Severity:** Medium 6.3 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:N/SI:H/SA:L`)
- **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:** Yes
- **Published:** 17 Dec 2025
- **Updated:** 18 Dec 2025
- **Also known as:** GHSA-9xwc-hfwc-8w59, MINI-pw8c-f933-247p, PYSEC-2026-1622

## What is CVE-2025-68144?

CVE-2025-68144 is a medium-severity command injection 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, the git_diff and git_checkout functions passed user-controlled arguments directly to git CLI commands without sanitization. Flag-like values (e.g., `--output=/path/to/file` for `git_diff`) would be interpreted as command-line options rather than git refs, enabling arbitrary file overwrites. The fix adds validation that rejects arguments starting with - and verifies the argument resolves to a valid git ref via rev_parse before execution. Users are advised to update to 2025.12.17 resolve this issue when it is released.

Weakness: CWE-88 (Improper Neutralization of Argument Delimiters in a Command)

## Which versions are affected by CVE-2025-68144?

3 open source packages ship an affected version, including mcp-server-git. It affects 1 product.


| Package | Ecosystem | 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: Lfprojects Model Context Protocol Servers.

## How do I fix CVE-2025-68144?

Upgrade mcp-server-git to 2025.12.18 or later.

## Is CVE-2025-68144 being exploited?

There is no known exploitation of CVE-2025-68144 in the wild and no public exploit code.

## Other vulnerabilities in modelcontextprotocol servers

- [CVE-2025-68143](https://insights.sbomify.com/CVE-2025-68143/): mcp-server-git's unrestricted git_init tool allows repository creation at arbitrary filesystem locations (medium 6.5)
- [CVE-2026-27735](https://insights.sbomify.com/CVE-2026-27735/): mcp-server-git : Path traversal in git_add allows staging files outside repository boundaries (medium 6.4)
- [CVE-2025-68145](https://insights.sbomify.com/CVE-2025-68145/): mcp-server-git has missing path validation when using --repository flag (medium 6.4)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2025-68144 and fix it if it is affected.

What it is: CVE-2025-68144 is a medium-severity command injection 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.
Exploitation: There is no known exploitation of CVE-2025-68144 in the wild and no public exploit code.

Affected packages and fixed versions:
- mcp-server-git (PyPI): affected all versions; fixed in 2025.12.18
- mcp-server-git (PyPI): affected all versions; fixed in 2025.12.18
- mcp-server-git (PyPI): affected all versions; fixed in 2025.12.18

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2025-68144/ (Markdown: https://insights.sbomify.com/CVE-2025-68144/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2025-68144
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2025-68144
- OSV: https://osv.dev/vulnerability/CVE-2025-68144

---
From sbomify Insights: https://insights.sbomify.com/CVE-2025-68144/
Summaries are generated and may contain mistakes; the official description above is the record.
