subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def run(cmd, check=True, cwd=None): result = subprocess.run(cmd, shell=True, capture_output=True, text=True, cwd=cwd) if check and result.returncode != 0: log(f"Error: {result.stderr}") sys.exit(1)- Confidence
- 98% confidence
- Finding
- result = subprocess.run(cmd, shell=True, capture_output=True, text=True, cwd=cwd)
