subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
"""Run command with shell timeout wrapper to handle stubborn child processes (skill-scanner).""" try: shell_cmd = f"timeout --signal=KILL {timeout} " + " ".join(shlex.quote(c) for c in cmd) r = subprocess.run(shell_cmd, shell=True, capture_output=True, text=True) return r.stdout + r.stderr, r.returncode except FileNotFoundError: return f"ERROR: command not found: {cmd[0]}", 127- Confidence
- 96% confidence
- Finding
- r = subprocess.run(shell_cmd, shell=True, capture_output=True, text=True)
