subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
print("hooks configured") """ result = subprocess.run( ["ssh", host, f"python3 -c '{python_script}'"], capture_output=True, text=True- Confidence
- 95% confidence
- Finding
- The script builds a remote command string using the user-supplied SSH host and embeds a Python script inside single quotes for execution over SSH. Because SSH treats the remote command as a shell command string, a crafted host alias or hostile SSH config/ProxyCommand context can turn this into unintended remote command execution or execution against an unexpected endpoint.
