subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def run_cmd(cmd, check=True): """Run a shell command and return stdout.""" try: result = subprocess.run(cmd, shell=True, check=check, capture_output=True, text=True) return result.stdout except subprocess.CalledProcessError as e: if check:- Confidence
- 99% confidence
- Finding
- result = subprocess.run(cmd, shell=True, check=check, capture_output=True, text=True)
