subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
def run_cmd(label: str, cmd: str, execute: bool): print(f"{label}: {cmd}") if execute: subprocess.run(cmd, shell=True, check=True) def command_control(args, default_area: str):- Confidence
- 99% confidence
- Finding
- The code executes a caller-provided string with subprocess.run(..., shell=True), which allows arbitrary shell execution in the context of the user running the skill. In this skill, the command comes from CLI arguments intended for smart-home control, so any untrusted or mistaken input can trigger arbitrary OS commands, not just constrained device actions.
