subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
f'/sc daily /st {trigger} /f /rl LIMITED' ) try: proc = subprocess.run(schtasks, shell=True, capture_output=True, text=True) ok = proc.returncode == 0 return {"ok": ok, "platform": "windows", "command": schtasks, "output": (proc.stdout or proc.stderr)[:300], "plan": plan["tier"]}- Confidence
- 88% confidence
- Finding
- The Windows task creation path builds a shell command string and executes it with shell=True. Although most inputs are internally derived, the command embeds executable and script paths whose quoting/escaping is fragile; if installation paths or environment context are attacker-influenced, this can enable command injection or unintended command execution while creating a persistent scheduled task.
