subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
output_path = self.task_dir / filename if use_curl: curl_cmd = ["curl", "-s", "-o", str(output_path), image_url] subprocess.run(curl_cmd, timeout=30) else: img_resp = requests.get(image_url, timeout=30) img_resp.raise_for_status()- Confidence
- 82% confidence
- Finding
- The code downloads a server-supplied filename to self.task_dir / filename without sanitizing the filename. If the remote ComfyUI server or its response is compromised, a filename containing path traversal sequences could cause files to be written outside the intended task directory, turning this subprocess-assisted download into an arbitrary file write primitive.
