subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
try: # 尝试使用 pbpaste (macOS) subprocess.run(["pbpaste", ">", "/tmp/clipboard.png"], shell=True, capture_output=True) if os.path.exists("/tmp/clipboard.png"): return "/tmp/clipboard.png" except:- Confidence
- 96% confidence
- Finding
- This call uses shell=True unnecessarily while attempting output redirection, which introduces shell execution into the code path. Although the current command string is static, shell usage increases attack surface and can behave unpredictably across platforms; combined with the hard-coded /tmp output path, it is an unsafe implementation pattern.
