subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
HOST = SSH_HOST def ssh(cmd, timeout=30): r = subprocess.run( ["ssh", "-o", "ServerAliveInterval=10", HOST, f"source ~/.zshrc && {cmd}"], capture_output=True, text=True, timeout=timeout )- Confidence
- 95% confidence
- Finding
- The ssh helper concatenates an arbitrary command string into a remote shell invocation (`source ~/.zshrc && {cmd}`), so any untrusted or improperly constrained input passed to `ssh()` becomes remote shell execution. In this file the current call sites are hardcoded, but the primitive itself is dangerous in a remote-execution skill because it normalizes shell-string injection as the control path.
