subprocess module call
- Category
- Dangerous Code Execution
- Confidence
- 90% confidence
- Finding
The GUI builds a command string with untrusted path data and passes it to subprocess.Popen. On Windows, specially crafted filenames or paths containing shell metacharacters can lead to command injection or unintended command execution when the app tries to open a cover file.
- Content
python if os.path.exists(cover_path): # 先尝试用默认程序打开图片 import subprocess subprocess.Popen(f'explorer "{cover_path}"') else: messagebox.showwarning("提示", "封面文件不存在!") except Exception as e:
