subprocess module call
- Category
- Dangerous Code Execution
- Confidence
- 92% confidence
- Finding
The script passes a manifest-controlled relpath directly to aria2c via '--out', allowing path traversal or option-style filenames to influence where files are written. While this is not shell command execution, it is still dangerous because an attacker-controlled TSV can overwrite files outside the intended output tree or cause unexpected behavior in the downloader.
- Content
python # aria2c 高并发 + 断点续传 + 16 分片 cmd = ["aria2c", "-x", "16", "-s", "16", "--continue", "--dir", outdir, "--out", relpath, "--file-allocation=none", "--summary-interval=0", url] r = subprocess.run(cmd, capture_output=True, text=True, timeout=3600) if r.returncode != 0 or not is_complete(target): # 空壳清理:分片残留 .aria2 for p in [target + ".aria2", tmp]:
