CVE-2025-68144: mcp-server-git argument injection in git_diff and git_checkout functions allows overwriting local files
In mcp-server-git versions prior to 2025.12.17, the gitdiff and gitcheckout functions passed user-controlled arguments directly to git CLI commands without sanitization. Flag-like values (e.g., --output=/path/to/file for gitdiff) 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 revparse before execution. Users are advised to update to 2025.12.17 resolve this issue when it is released.
Other sources
In mcp-server-git versions prior to 2025.12.18, the gitdiff and gitcheckout functions passed user-controlled arguments directly to git CLI commands without sanitization. Flag-like values (e.g., --output=/path/to/file for gitdiff) 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 revparse before execution. Users are advised to update to 2025.12.18 resolve this issue.
Thank you to https://hackerone.com/yardenporat for reporting.
— GitHub
Affected Software
Event History
Frequently Asked Questions
What is the severity of CVE-2025-68144?
CVE-2025-68144 has a medium severity due to the potential for command injection vulnerabilities.
How do I fix CVE-2025-68144?
To fix CVE-2025-68144, update mcp-server-git to version 2025.12.17 or later.
What symptoms indicate a system is vulnerable to CVE-2025-68144?
Indicators of vulnerability to CVE-2025-68144 include unexpected command execution when user-controlled input is provided to git CLI commands.
Which software versions are affected by CVE-2025-68144?
CVE-2025-68144 affects mcp-server-git versions prior to 2025.12.17 and prior to 2025.11.25 from pip.
Is there a way to mitigate CVE-2025-68144 if I cannot upgrade?
If an upgrade is not feasible, consider sanitizing user inputs to prevent untrusted arguments from being passed to git CLI commands.