subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def execute(self, command: str, timeout: int = 60) -> ExecutionResult: logger.debug("local_execute", command=command[:80]) try: result = subprocess.run( command, shell=self._shell, capture_output=True,- Confidence
- 96% confidence
- Finding
- The executor passes a caller-controlled command string directly to subprocess.run with shell=True, which enables arbitrary shell execution on the local host. In a skill that automates server operations, this is especially dangerous because upstream inputs may be influenced by users, configs, or LLM-generated content, turning this into command injection or unrestricted code execution.
