subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
print(f"[DEBUG] URL: {url}") # 使用 web_fetch 工具 result = subprocess.run( ['python3', '-c', f''' import subprocess result = subprocess.run(- Confidence
- 95% confidence
- Finding
- The code builds a Python program with an f-string and passes it to `python3 -c`, embedding `url` directly into executable source. If an attacker can influence `query` or `url`, characters such as quotes can break out of the intended string literal and lead to arbitrary Python code execution, making this a command/code injection issue rather than just ordinary subprocess use.
