subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
return tmp_path except Exception as e: # 尝试 curl result = subprocess.run(['curl', '-s', '-o', tmp_path, url], capture_output=True) if result.returncode != 0: raise Exception(f"下载失败: {e}") return tmp_path- Confidence
- 80% confidence
- Finding
- The script downloads arbitrary user-supplied URLs, including through a curl fallback, without any allowlist, scheme restriction beyond string prefix checks, timeout, size limit, or destination validation. In an agent or server environment, this creates SSRF-style network access and lets an attacker make the host reach internal services or consume resources via crafted URLs.
