Context Dependent Risk:
Local 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 /").
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.
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| mcp-watch | npm | <= 0.1.2 |
The vulnerability is a classic command injection in the cloneRepo function of the MCPScanner class. The provided patch in commit e7da78c5b4b960f8b66c254059ad9ebc544a91a6 clearly shows the remediation. The vulnerable code was using execSync to shell out to git clone, and the user-controlled url was concatenated directly into the command string. This is a textbook example of command injection. The fix replaces execSync with spawnSync, which correctly handles arguments by passing them as an array to the executable, thus preventing shell interpretation of special characters in the URL. The vulnerable function is therefore MCPScanner.cloneRepo as it is the function that contains the dangerous call to execSync with unsanitized user input.
MCPScanner.cloneReposrc/scanner/McpScanner.ts