subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
# On Windows, commands like npx/node need shell=True or .cmd suffix use_shell = sys.platform == "win32" proc = subprocess.Popen( command, stdin=subprocess.PIPE, stdout=subprocess.PIPE,- Confidence
- 88% confidence
- Finding
- The code executes an external command supplied by the caller and, on Windows, enables `shell=True`, which changes argument handling and can allow shell metacharacter interpretation. In a tool whose purpose is to connect to arbitrary MCP servers, this creates real command-execution risk if untrusted input reaches `command`, especially because the process inherits a merged environment and is run without validation or user warning.
