subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
self.rate_limiter.acquire() use_shell = isinstance(task.command, str) proc = subprocess.run( task.command if use_shell else task.command.split(), capture_output=True, text=True,- Confidence
- 99% confidence
- Finding
- The code executes task.command from task input and sets shell=True whenever the command is a string, which it always is by type declaration. This allows arbitrary shell command execution from untrusted task definitions, enabling full remote code execution with the privileges of the batch processor.
