{"id":"CVE-2025-66401","aliases":["EUVD-2025-200116","GHSA-27m7-ffhq-jqrm"],"status":"published","title":"MCP Watch has a Critical Command Injection in cloneRepo allows Remote Code Execution (RCE) via malicious URL","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.","severity":{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-12","score":0.02209,"percentile":0.82844,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":false},"cwes":["CWE-78"],"published":"2025-12-01T22:43:26Z","modified":"2026-10-28T02:31:01Z","affected":[{"source":"ghsa","ecosystem":"npm","package":"mcp-watch","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"0.1.2"}]}]},{"source":"osv","ecosystem":"npm","package":"mcp-watch","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"last_affected":"0.1.2"}]}]}],"products":[{"vendor":"kapilduraphe","product":"mcp-watch"},{"vendor":"kapilduraphe","product":"mcp_watch"}],"references":[{"url":"https://github.com/kapilduraphe/mcp-watch/security/advisories/GHSA-27m7-ffhq-jqrm","tags":["x_refsource_CONFIRM","Exploit","Vendor Advisory","advisory","web"]},{"url":"https://github.com/kapilduraphe/mcp-watch/commit/e7da78c5b4b960f8b66c254059ad9ebc544a91a6","tags":["x_refsource_MISC","Patch","fix","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-66401","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-27m7-ffhq-jqrm"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/66xxx/CVE-2025-66401.json","tags":["advisory"]},{"url":"https://github.com/kapilduraphe/mcp-watch","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2025-66401","title":"MCP Watch has a Critical Command Injection in cloneRepo allows Remote Code Execution (RCE) via malicious URL","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.","status":"published","published":"2025-12-01T22:43:26.639Z","modified":"2025-12-02T14:14:16.297Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"cna"}],"cwes":["CWE-78"],"updated_at":"2026-11-02T14:32:53.157279Z"}],"euvd":[{"id":"EUVD-2025-200116","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.","status":"published","published":"2025-12-01T22:43:26Z","modified":"2025-12-02T14:14:16Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T19:49:11.096002Z"}],"ghsa":[{"id":"GHSA-27m7-ffhq-jqrm","title":"MCP Watch has a Critical Command Injection in cloneRepo allows Remote Code Execution (RCE) via malicious URL","description":"### Summary\nThe `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.\n\n### Details\nThe vulnerability exists in the src/scanner/MCPScanner.ts file within the cloneRepo method.\n\n[https://github.com/kapilduraphe/mcp-watch/blob/0fca7228bd313ae5aa938d61311377e88ce6e682/src/scanner/McpScanner.ts#L181](https://github.com/kapilduraphe/mcp-watch/blob/0fca7228bd313ae5aa938d61311377e88ce6e682/src/scanner/McpScanner.ts#L181)\n\nThe code uses child_process.execSync to execute a git clone command:\n\nBecause execSync spawns a shell (defaulting to `/bin/sh` on Unix or` cmd.exe` on Windows), any shell metacharacters present in the url argument will be interpreted by the shell. The application does not validate that the url is a valid Git URL, nor does it sanitize input for shell metacharacters.\n\n### PoC\nInstall the package or clone the repository.\n\nRun the scanner using the CLI (or invoke scanRepository programmatically).\n\nProvide a malicious URL containing a command separator (e.g., ;, \u0026, or |) and a system command.\npayload : `npm run scan:github \"https://github.com/kapilduraphe/mcp-watch \u0026 calc.exe\"`\n\n\u003cimg width=\"1918\" height=\"1046\" alt=\"image\" src=\"https://github.com/user-attachments/assets/021c1dfa-3f87-483c-aecb-6939bcf9c925\" /\u003e\n\n\n\n### Impact\nSeverity: **Critical**\n\n**CVSS Score**: 9.8 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)\nDescription: This vulnerability allows an attacker to execute arbitrary code on the machine running the scanner.\n\nIf run by a developer locally, it compromises their workstation.\n\nIf deployed as a hosted scanning service, it grants the attacker full control over the server (RCE), leading to potential data exfiltration, service disruption, or further lateral movement within the infrastructure.\n\n**Context Dependent Risk:**\n\nLocal CLI : If you run this tool locally on your own machine, you are \"hacking yourself.\" The risk is limited unless you copy-paste a malicious URL sent by someone else (e.g., \"Hey, check this repo scan: npm run scan \"https://git./..; rm -rf /\").\n\n**Web Service / CI Pipeline (Critical Risk)**: If this scanner is deployed as a web service (e.g., \"Paste your repo URL to scan\"), an attacker can take full control of the server immediately.","status":"published","published":"2025-12-02T00:38:14Z","modified":"2025-12-02T00:38:15Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-78"],"updated_at":"2026-11-02T14:39:11.110487Z"}],"nvd":[{"id":"CVE-2025-66401","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.","status":"published","published":"2025-12-01T23:15:53.227Z","modified":"2026-10-18T18:10:00.1Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"secondary"}],"cwes":["CWE-78"],"updated_at":"2026-11-02T14:11:47.746175Z"}],"osv":[{"id":"CVE-2025-66401","title":"MCP Watch has a Critical Command Injection in cloneRepo allows Remote Code Execution (RCE) via malicious URL","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.","status":"published","published":"2025-12-01T22:43:26.639Z","modified":"2026-10-28T02:31:01.774764622Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-78"],"updated_at":"2026-11-02T15:44:52.202386Z"},{"id":"GHSA-27m7-ffhq-jqrm","title":"MCP Watch has a Critical Command Injection in cloneRepo allows Remote Code Execution (RCE) via malicious URL","description":"### Summary\nThe `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.\n\n### Details\nThe vulnerability exists in the src/scanner/MCPScanner.ts file within the cloneRepo method.\n\n[https://github.com/kapilduraphe/mcp-watch/blob/0fca7228bd313ae5aa938d61311377e88ce6e682/src/scanner/McpScanner.ts#L181](https://github.com/kapilduraphe/mcp-watch/blob/0fca7228bd313ae5aa938d61311377e88ce6e682/src/scanner/McpScanner.ts#L181)\n\nThe code uses child_process.execSync to execute a git clone command:\n\nBecause execSync spawns a shell (defaulting to `/bin/sh` on Unix or` cmd.exe` on Windows), any shell metacharacters present in the url argument will be interpreted by the shell. The application does not validate that the url is a valid Git URL, nor does it sanitize input for shell metacharacters.\n\n### PoC\nInstall the package or clone the repository.\n\nRun the scanner using the CLI (or invoke scanRepository programmatically).\n\nProvide a malicious URL containing a command separator (e.g., ;, \u0026, or |) and a system command.\npayload : `npm run scan:github \"https://github.com/kapilduraphe/mcp-watch \u0026 calc.exe\"`\n\n\u003cimg width=\"1918\" height=\"1046\" alt=\"image\" src=\"https://github.com/user-attachments/assets/021c1dfa-3f87-483c-aecb-6939bcf9c925\" /\u003e\n\n\n\n### Impact\nSeverity: **Critical**\n\n**CVSS Score**: 9.8 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)\nDescription: This vulnerability allows an attacker to execute arbitrary code on the machine running the scanner.\n\nIf run by a developer locally, it compromises their workstation.\n\nIf deployed as a hosted scanning service, it grants the attacker full control over the server (RCE), leading to potential data exfiltration, service disruption, or further lateral movement within the infrastructure.\n\n**Context Dependent Risk:**\n\nLocal CLI : If you run this tool locally on your own machine, you are \"hacking yourself.\" The risk is limited unless you copy-paste a malicious URL sent by someone else (e.g., \"Hey, check this repo scan: npm run scan \"https://git./..; rm -rf /\").\n\n**Web Service / CI Pipeline (Critical Risk)**: If this scanner is deployed as a web service (e.g., \"Paste your repo URL to scan\"), an attacker can take full control of the server immediately.","status":"published","published":"2025-12-02T00:38:14Z","modified":"2025-12-02T01:29:49.678864Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-78"],"updated_at":"2026-11-02T15:46:33.956911Z"}]}}
