subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
ssh += ["-i", os.path.expanduser(key)] ssh += [f"{user}@{host}", cmd] try: r = subprocess.run(ssh, capture_output=True, text=True, timeout=timeout+5) return r.stdout.strip() except Exception: return None- Confidence
- 93% confidence
- Finding
- The subprocess invocation itself is not the core issue, but it executes an SSH client with a remotely interpreted command string built from configuration and user-controlled values such as job_id and workdir. Because the remote shell will parse that command, an attacker who can influence those fields can trigger command injection on the remote host, making this a real security issue in this context.
