subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
except ImportError: print("⚠️ 导出 Excel 需要 openpyxl 库,正在自动安装...") import subprocess subprocess.check_call([sys.executable, "-m", "pip", "install", "openpyxl", "-q"]) import openpyxl from openpyxl.styles import Font, Alignment, PatternFill, Border, Side- Confidence
- 93% confidence
- Finding
- The script automatically invokes pip to install openpyxl at runtime when Excel export is requested and the dependency is missing. This causes unprompted code execution and network access outside the core OCR task, and it may pull and execute package installation logic in environments where dependency changes are controlled or prohibited.
