subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
full_env = {**os.environ, **self.env} cmd = self.command + self.args try: self._proc = subprocess.Popen( cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE,- Confidence
- 93% confidence
- Finding
- The client launches arbitrary executables taken from user-controlled MCP configuration files and inherits the current process environment, creating a direct code-execution boundary. Even though `shell=False` avoids shell injection, invoking untrusted MCP servers is still dangerous because discovery automatically executes them and then exchanges JSON-RPC messages with them.
