subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
exec_args = shlex.split(actual) if not exec_args: raise ValueError("empty command after parsing") result = subprocess.run( exec_args, shell=False, capture_output=True,- Confidence
- 91% confidence
- Finding
- Diagnostics commands are loaded from configuration and then executed as arbitrary processes after only a shallow metacharacter blacklist. Even with shell=False, this still permits execution of attacker-controlled binaries/arguments if an adversary can modify config, making it an unsafe arbitrary command execution surface in a privileged watchdog component.
